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

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 2452773002: [Extensions] Limit Extension WebUI (Closed)
Patch Set: sky's Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index 53e9ea51637328d1bcd70dbfd6a275d05264c6d5..5ccd82ac30b10d8c1af19e4b42aae1ad7258a972 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -285,23 +285,6 @@ WebUIController* NewWebUI<WelcomeWin10UI>(WebUI* web_ui, const GURL& url) {
}
#endif // defined(OS_WIN)
-#if defined(ENABLE_EXTENSIONS)
-// Only create ExtensionWebUI for URLs that are allowed extension bindings,
-// hosted by actual tabs.
-bool NeedsExtensionWebUI(Profile* profile, const GURL& url) {
- if (!profile)
- return false;
-
- const extensions::Extension* extension =
- extensions::ExtensionRegistry::Get(profile)->enabled_extensions().
- GetExtensionOrAppByURL(url);
- // Allow bindings for all packaged extensions and component hosted apps.
- return extension &&
- (!extension->is_hosted_app() ||
- extension->location() == extensions::Manifest::COMPONENT);
-}
-#endif
-
bool IsAboutUI(const GURL& url) {
return (url.host() == chrome::kChromeUIChromeURLsHost ||
url.host() == chrome::kChromeUICreditsHost ||
@@ -329,7 +312,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
Profile* profile,
const GURL& url) {
#if defined(ENABLE_EXTENSIONS)
- if (NeedsExtensionWebUI(profile, url))
+ if (ExtensionWebUI::NeedsExtensionWebUI(profile, url))
return &NewWebUI<ExtensionWebUI>;
#endif
@@ -692,7 +675,7 @@ bool ChromeWebUIControllerFactory::UseWebUIBindingsForURL(
// Extensions are rendered via WebUI in tabs, but don't actually need WebUI
// bindings (see the ExtensionWebUI constructor).
needs_extensions_web_ui =
- NeedsExtensionWebUI(Profile::FromBrowserContext(browser_context), url);
+ ExtensionWebUI::NeedsExtensionWebUI(browser_context, url);
#endif
return !needs_extensions_web_ui && UseWebUIForURL(browser_context, url);
}
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698