| Index: content/browser/web_contents/render_view_host_manager.cc
|
| ===================================================================
|
| --- content/browser/web_contents/render_view_host_manager.cc (revision 176042)
|
| +++ content/browser/web_contents/render_view_host_manager.cc (working copy)
|
| @@ -16,7 +16,6 @@
|
| #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"
|
| @@ -25,6 +24,7 @@
|
| #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();
|
| - 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;
|
| + 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;
|
| }
|
| - } 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,11 +453,13 @@
|
| const NavigationEntryImpl* new_entry) const {
|
| NavigationControllerImpl& controller =
|
| delegate_->GetControllerForRenderManager();
|
| + WebUIControllerFactory* factory =
|
| + GetContentClient()->browser()->GetWebUIControllerFactory();
|
| return curr_entry && web_ui_.get() &&
|
| - (WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType(
|
| - controller.GetBrowserContext(), curr_entry->GetURL()) ==
|
| - WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType(
|
| - controller.GetBrowserContext(), new_entry->GetURL()));
|
| + (factory->GetWebUIType(controller.GetBrowserContext(),
|
| + curr_entry->GetURL()) ==
|
| + factory->GetWebUIType(controller.GetBrowserContext(),
|
| + new_entry->GetURL()));
|
| }
|
|
|
| SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
|
| @@ -532,8 +534,10 @@
|
|
|
| // If we are navigating from a blank SiteInstance to a WebUI, make sure we
|
| // create a new SiteInstance.
|
| - if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL(
|
| - browser_context, dest_url)) {
|
| + const WebUIControllerFactory* web_ui_factory =
|
| + GetContentClient()->browser()->GetWebUIControllerFactory();
|
| + if (web_ui_factory &&
|
| + web_ui_factory->UseWebUIForURL(browser_context, dest_url)) {
|
| return SiteInstance::CreateForURL(browser_context, dest_url);
|
| }
|
|
|
|
|