OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/about_flags.h" | 8 #include "chrome/browser/about_flags.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 return UseWebUIForURL(browser_context, url) || | 450 return UseWebUIForURL(browser_context, url) || |
451 // javacsript: URLs are allowed to run in Web UI pages | 451 // javacsript: URLs are allowed to run in Web UI pages |
452 url.SchemeIs(chrome::kJavaScriptScheme) || | 452 url.SchemeIs(chrome::kJavaScriptScheme) || |
453 // It's possible to load about:blank in a Web UI renderer. | 453 // It's possible to load about:blank in a Web UI renderer. |
454 // See http://crbug.com/42547 | 454 // See http://crbug.com/42547 |
455 url.spec() == chrome::kAboutBlankURL || | 455 url.spec() == chrome::kAboutBlankURL || |
456 // Chrome URLs crash, kill, hang, and shorthang are allowed. | 456 // Chrome URLs crash, kill, hang, and shorthang are allowed. |
457 url == GURL(chrome::kChromeUICrashURL) || | 457 url == GURL(chrome::kChromeUICrashURL) || |
458 url == GURL(chrome::kChromeUIKillURL) || | 458 url == GURL(chrome::kChromeUIKillURL) || |
459 url == GURL(chrome::kChromeUIHangURL) || | 459 url == GURL(chrome::kChromeUIHangURL) || |
460 url == GURL(chrome::kChromeUIShorthangURL) || | 460 url == GURL(content::kChromeUIShorthangURL) || |
461 // Data URLs are usually not allowed in WebUI for security reasons. | 461 // Data URLs are usually not allowed in WebUI for security reasons. |
462 // BalloonHosts are one exception needed by ChromeOS, and are safe because | 462 // BalloonHosts are one exception needed by ChromeOS, and are safe because |
463 // they cannot be scripted by other pages. | 463 // they cannot be scripted by other pages. |
464 (data_urls_allowed && url.SchemeIs(chrome::kDataScheme)); | 464 (data_urls_allowed && url.SchemeIs(chrome::kDataScheme)); |
465 } | 465 } |
466 | 466 |
467 WebUIController* ChromeWebUIControllerFactory::CreateWebUIControllerForURL( | 467 WebUIController* ChromeWebUIControllerFactory::CreateWebUIControllerForURL( |
468 WebUI* web_ui, | 468 WebUI* web_ui, |
469 const GURL& url) const { | 469 const GURL& url) const { |
470 Profile* profile = Profile::FromWebUI(web_ui); | 470 Profile* profile = Profile::FromWebUI(web_ui); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 593 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
594 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 594 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
595 | 595 |
596 // Android doesn't use the plugins pages. | 596 // Android doesn't use the plugins pages. |
597 if (page_url.host() == chrome::kChromeUIPluginsHost) | 597 if (page_url.host() == chrome::kChromeUIPluginsHost) |
598 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 598 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
599 #endif | 599 #endif |
600 | 600 |
601 return NULL; | 601 return NULL; |
602 } | 602 } |
OLD | NEW |