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

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

Issue 11348358: Remove an obsolete NULL test for TabContents in NeedsExtensionWebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | 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 b6402d271fd6d68bfdb67a5583abb6e1605a9e56..98322d84a9437e07b7c00949a69e71ea83434aaf 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -147,16 +147,10 @@ WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) {
}
// Only create ExtensionWebUI for URLs that are allowed extension bindings,
-// hosted by actual tabs. If there is no TabContents, it likely refers
-// to another container type, like an extension background page. If there is
-// no WebUI (it's not accessible when calling GetWebUIType and related
-// functions) then we conservatively assume that we need a WebUI.
-bool NeedsExtensionWebUI(WebUI* web_ui,
- Profile* profile,
- const GURL& url) {
+// hosted by actual tabs.
+bool NeedsExtensionWebUI(Profile* profile, const GURL& url) {
ExtensionService* service = profile ? profile->GetExtensionService() : NULL;
- return service && service->ExtensionBindingsAllowed(url) &&
- (!web_ui || TabContents::FromWebContents(web_ui->GetWebContents()));
+ return service && service->ExtensionBindingsAllowed(url);
}
// Returns a function that can be used to create the right type of WebUI for a
@@ -166,7 +160,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
Profile* profile,
const GURL& url) {
#if defined(ENABLE_EXTENSIONS)
- if (NeedsExtensionWebUI(web_ui, profile, url))
+ if (NeedsExtensionWebUI(profile, url))
return &NewWebUI<ExtensionWebUI>;
#endif
@@ -446,8 +440,7 @@ bool ChromeWebUIControllerFactory::UseWebUIBindingsForURL(
content::BrowserContext* browser_context, const GURL& url) const {
// Extensions are rendered via WebUI in tabs, but don't actually need WebUI
// bindings (see the ExtensionWebUI constructor).
- return !NeedsExtensionWebUI(NULL,
- Profile::FromBrowserContext(browser_context),
+ return !NeedsExtensionWebUI(Profile::FromBrowserContext(browser_context),
url) &&
UseWebUIForURL(browser_context, url);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698