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

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

Issue 12387070: content: Move more constants from url_constants.h into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « content/browser/web_contents/debug_urls.cc ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(chrome::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() == chrome::kAboutBlankURL || 88 url.spec() == chrome::kAboutBlankURL ||
89 // Chrome URLs crash, kill, hang, and shorthang are allowed. 89 // Chrome URLs crash, kill, hang, and shorthang are allowed.
90 url == GURL(chrome::kChromeUICrashURL) || 90 url == GURL(kChromeUICrashURL) ||
91 url == GURL(chrome::kChromeUIKillURL) || 91 url == GURL(kChromeUIKillURL) ||
92 url == GURL(chrome::kChromeUIHangURL) || 92 url == GURL(kChromeUIHangURL) ||
93 url == GURL(content::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/debug_urls.cc ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698