Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: content/browser/webui/web_ui_controller_factory_registry.cc

Issue 23283007: Move kJavaScriptScheme into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: content:: is necessary in web_drag_source_mac.mm Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/webui/web_ui_controller_factory_registry.h" 5 #include "content/browser/webui/web_ui_controller_factory_registry.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "content/public/common/url_constants.h" 8 #include "content/public/common/url_constants.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 return false; 76 return false;
77 } 77 }
78 78
79 bool WebUIControllerFactoryRegistry::IsURLAcceptableForWebUI( 79 bool WebUIControllerFactoryRegistry::IsURLAcceptableForWebUI(
80 BrowserContext* browser_context, 80 BrowserContext* browser_context,
81 const GURL& url, 81 const GURL& url,
82 bool data_urls_allowed) const { 82 bool data_urls_allowed) const {
83 return UseWebUIForURL(browser_context, url) || 83 return UseWebUIForURL(browser_context, url) ||
84 // javascript: URLs are allowed to run in Web UI pages. 84 // javascript: URLs are allowed to run in Web UI pages.
85 url.SchemeIs(chrome::kJavaScriptScheme) || 85 url.SchemeIs(kJavaScriptScheme) ||
86 // It's possible to load about:blank in a Web UI renderer. 86 // It's possible to load about:blank in a Web UI renderer.
87 // See http://crbug.com/42547 87 // See http://crbug.com/42547
88 url.spec() == kAboutBlankURL || 88 url.spec() == kAboutBlankURL ||
89 // Chrome URLs crash, kill, hang, and shorthang are allowed. 89 // Chrome URLs crash, kill, hang, and shorthang are allowed.
90 url == GURL(kChromeUICrashURL) || 90 url == GURL(kChromeUICrashURL) ||
91 url == GURL(kChromeUIKillURL) || 91 url == GURL(kChromeUIKillURL) ||
92 url == GURL(kChromeUIHangURL) || 92 url == GURL(kChromeUIHangURL) ||
93 url == GURL(kChromeUIShorthangURL) || 93 url == GURL(kChromeUIShorthangURL) ||
94 // Data URLs are usually not allowed in WebUI for security reasons. 94 // Data URLs are usually not allowed in WebUI for security reasons.
95 // BalloonHosts are one exception needed by ChromeOS, and are safe because 95 // BalloonHosts are one exception needed by ChromeOS, and are safe because
96 // they cannot be scripted by other pages. 96 // they cannot be scripted by other pages.
97 (data_urls_allowed && url.SchemeIs(chrome::kDataScheme)); 97 (data_urls_allowed && url.SchemeIs(chrome::kDataScheme));
98 } 98 }
99 99
100 WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() { 100 WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() {
101 } 101 }
102 102
103 WebUIControllerFactoryRegistry::~WebUIControllerFactoryRegistry() { 103 WebUIControllerFactoryRegistry::~WebUIControllerFactoryRegistry() {
104 } 104 }
105 105
106 } // namespace content 106 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_drag_source_mac.mm ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698