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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 9288074: Rename WebUIFactory to WebUIControllerFactory since that's what it creates now. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: blah Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/tab_contents/tab_contents.cc
===================================================================
--- content/browser/tab_contents/tab_contents.cc (revision 119190)
+++ content/browser/tab_contents/tab_contents.cc (working copy)
@@ -46,7 +46,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_view.h"
-#include "content/public/browser/web_ui_factory.h"
+#include "content/public/browser/web_ui_controller_factory.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_restriction.h"
@@ -128,6 +128,7 @@
using content::WebContentsObserver;
using content::WebUI;
using content::WebUIController;
+using content::WebUIControllerFactory;
namespace {
@@ -441,10 +442,13 @@
}
content::WebUI* TabContents::CreateWebUI(const GURL& url) {
+ WebUIControllerFactory* factory =
+ content::GetContentClient()->browser()->GetWebUIControllerFactory();
+ if (!factory)
+ return NULL;
WebUIImpl* web_ui = new WebUIImpl(this);
WebUIController* controller =
- content::GetContentClient()->browser()->GetWebUIFactory()->
- CreateWebUIForURL(web_ui, url);
+ factory->CreateWebUIControllerForURL(web_ui, url);
if (controller) {
web_ui->SetController(controller);
return web_ui;
@@ -834,9 +838,11 @@
// For security, we should never send non-Web-UI URLs to a Web UI renderer.
// Double check that here.
int enabled_bindings = dest_render_view_host->enabled_bindings();
- bool is_allowed_in_web_ui_renderer = content::GetContentClient()->
- browser()->GetWebUIFactory()->IsURLAcceptableForWebUI(GetBrowserContext(),
- entry.GetURL());
+ WebUIControllerFactory* factory =
+ content::GetContentClient()->browser()->GetWebUIControllerFactory();
+ bool is_allowed_in_web_ui_renderer =
+ factory &&
+ factory->IsURLAcceptableForWebUI(GetBrowserContext(), entry.GetURL());
#if defined(OS_CHROMEOS)
is_allowed_in_web_ui_renderer |= entry.GetURL().SchemeIs(chrome::kDataScheme);
#endif
@@ -1104,8 +1110,11 @@
}
WebUI::TypeID TabContents::GetWebUITypeForCurrentState() {
- return content::GetContentClient()->browser()->GetWebUIFactory()->
- GetWebUIType(GetBrowserContext(), GetURL());
+ WebUIControllerFactory* factory =
+ content::GetContentClient()->browser()->GetWebUIControllerFactory();
+ if (!factory)
+ return WebUI::kNoWebUI;
+ return factory->GetWebUIType(GetBrowserContext(), GetURL());
}
content::WebUI* TabContents::GetWebUIForCurrentState() {

Powered by Google App Engine
This is Rietveld 408576698