Index: content/browser/web_contents/render_view_host_manager.cc |
=================================================================== |
--- content/browser/web_contents/render_view_host_manager.cc (revision 175970) |
+++ content/browser/web_contents/render_view_host_manager.cc (working copy) |
@@ -16,6 +16,7 @@ |
#include "content/browser/web_contents/interstitial_page_impl.h" |
#include "content/browser/web_contents/navigation_controller_impl.h" |
#include "content/browser/web_contents/navigation_entry_impl.h" |
+#include "content/browser/webui/web_ui_controller_factory_registry.h" |
#include "content/browser/webui/web_ui_impl.h" |
#include "content/common/view_messages.h" |
#include "content/port/browser/render_widget_host_view_port.h" |
@@ -24,7 +25,6 @@ |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/web_contents_view.h" |
#include "content/public/browser/web_ui_controller.h" |
-#include "content/public/browser/web_ui_controller_factory.h" |
#include "content/public/common/content_switches.h" |
#include "content/public/common/url_constants.h" |
@@ -414,20 +414,20 @@ |
render_view_host_->GetSiteInstance()->GetSiteURL(); |
BrowserContext* browser_context = |
delegate_->GetControllerForRenderManager().GetBrowserContext(); |
- const WebUIControllerFactory* web_ui_factory = |
- GetContentClient()->browser()->GetWebUIControllerFactory(); |
- if (web_ui_factory) { |
- if (web_ui_factory->UseWebUIForURL(browser_context, current_url)) { |
- // Force swap if it's not an acceptable URL for Web UI. |
- // Here, data URLs are never allowed. |
- if (!web_ui_factory->IsURLAcceptableForWebUI(browser_context, |
- new_entry->GetURL(), false)) |
- return true; |
- } else { |
- // Force swap if it's a Web UI URL. |
- if (web_ui_factory->UseWebUIForURL(browser_context, new_entry->GetURL())) |
- return true; |
+ if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL( |
+ browser_context, current_url)) { |
+ // Force swap if it's not an acceptable URL for Web UI. |
+ // Here, data URLs are never allowed. |
+ if (!WebUIControllerFactoryRegistry::GetInstance()->IsURLAcceptableForWebUI( |
+ browser_context, new_entry->GetURL(), false)) { |
+ return true; |
} |
+ } else { |
+ // Force swap if it's a Web UI URL. |
+ if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL( |
+ browser_context, new_entry->GetURL())) { |
+ return true; |
+ } |
} |
if (GetContentClient()->browser()->ShouldSwapProcessesForNavigation( |
@@ -453,13 +453,11 @@ |
const NavigationEntryImpl* new_entry) const { |
NavigationControllerImpl& controller = |
delegate_->GetControllerForRenderManager(); |
- WebUIControllerFactory* factory = |
- GetContentClient()->browser()->GetWebUIControllerFactory(); |
return curr_entry && web_ui_.get() && |
- (factory->GetWebUIType(controller.GetBrowserContext(), |
- curr_entry->GetURL()) == |
- factory->GetWebUIType(controller.GetBrowserContext(), |
- new_entry->GetURL())); |
+ (WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( |
+ controller.GetBrowserContext(), curr_entry->GetURL()) == |
+ WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( |
+ controller.GetBrowserContext(), new_entry->GetURL())); |
} |
SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry( |
@@ -534,10 +532,8 @@ |
// If we are navigating from a blank SiteInstance to a WebUI, make sure we |
// create a new SiteInstance. |
- const WebUIControllerFactory* web_ui_factory = |
- GetContentClient()->browser()->GetWebUIControllerFactory(); |
- if (web_ui_factory && |
- web_ui_factory->UseWebUIForURL(browser_context, dest_url)) { |
+ if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL( |
+ browser_context, dest_url)) { |
return SiteInstance::CreateForURL(browser_context, dest_url); |
} |