Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / managed_mode / managed_mode_url_filter.cc
index 8700e56..75fb303 100644 (file)
@@ -37,10 +37,11 @@ struct ManagedModeURLFilter::Contents {
 
 namespace {
 
-const char* kStandardSchemes[] = {
+// URL schemes not in this list (e.g., file:// and chrome://) will always be
+// allowed.
+const char* kFilteredSchemes[] = {
   "http",
   "https",
-  "file",
   "ftp",
   "gopher",
   "ws",
@@ -204,9 +205,9 @@ GURL ManagedModeURLFilter::Normalize(const GURL& url) {
 }
 
 // static
-bool ManagedModeURLFilter::HasStandardScheme(const GURL& url) {
-  for (size_t i = 0; i < arraysize(kStandardSchemes); ++i) {
-      if (url.scheme() == kStandardSchemes[i])
+bool ManagedModeURLFilter::HasFilteredScheme(const GURL& url) {
+  for (size_t i = 0; i < arraysize(kFilteredSchemes); ++i) {
+      if (url.scheme() == kFilteredSchemes[i])
         return true;
     }
   return false;
@@ -260,7 +261,7 @@ ManagedModeURLFilter::GetFilteringBehaviorForURL(const GURL& url) const {
   DCHECK(CalledOnValidThread());
 
   // URLs with a non-standard scheme (e.g. chrome://) are always allowed.
-  if (!HasStandardScheme(url))
+  if (!HasFilteredScheme(url))
     return ALLOW;
 
   // Check manual overrides for the exact URL.