OLD | NEW |
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 Loading... |
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 |
OLD | NEW |