summaryrefslogtreecommitdiffstats
path: root/content/browser/web_contents/web_contents_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 21:41:48 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 21:41:48 +0000
commit526fcbad45cd81bc953aa643bf6b7229497fa919 (patch)
tree82c003c6e26c86813ddbe50317294c9449167ae0 /content/browser/web_contents/web_contents_impl.cc
parent1d421c2af34c43b3478f00fc45ab9fc17aef071b (diff)
downloadchromium_src-526fcbad45cd81bc953aa643bf6b7229497fa919.zip
chromium_src-526fcbad45cd81bc953aa643bf6b7229497fa919.tar.gz
chromium_src-526fcbad45cd81bc953aa643bf6b7229497fa919.tar.bz2
Revert 175822
After more investigation of what it would take to share the webui code framework from chrome with content, it didn't seam feasible to do this. The code in chrome (i.e. ChromeURLDataManager) is heavily tied to chrome, and is used by chrome for non-webui stuff. The JS code is also specific to Chrome. It seems better to not bring in all this stuff to content. > Allow multiple WebUIControllerFactory objects to be registered. This makes is possible to implement webui inside content. > Review URL: https://codereview.chromium.org/11783038 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/11818036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175890 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/web_contents/web_contents_impl.cc')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index cc6659a..6a05899 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -37,7 +37,6 @@
#include "content/browser/web_contents/interstitial_page_impl.h"
#include "content/browser/web_contents/navigation_entry_impl.h"
#include "content/browser/web_contents/web_contents_view_guest.h"
-#include "content/browser/webui/web_ui_controller_factory_registry.h"
#include "content/browser/webui/web_ui_impl.h"
#include "content/common/browser_plugin_messages.h"
#include "content/common/icon_messages.h"
@@ -65,6 +64,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_controller_factory.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_restriction.h"
@@ -834,9 +834,13 @@ WebContentsView* WebContentsImpl::GetView() const {
}
WebUI* WebContentsImpl::CreateWebUI(const GURL& url) {
+ WebUIControllerFactory* factory =
+ GetContentClient()->browser()->GetWebUIControllerFactory();
+ if (!factory)
+ return NULL;
WebUIImpl* web_ui = new WebUIImpl(this);
- WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()->
- CreateWebUIControllerForURL(web_ui, url);
+ WebUIController* controller =
+ factory->CreateWebUIControllerForURL(web_ui, url);
if (controller) {
web_ui->SetController(controller);
return web_ui;
@@ -1583,10 +1587,13 @@ bool WebContentsImpl::NavigateToEntry(
// 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->GetEnabledBindings();
+ WebUIControllerFactory* factory =
+ GetContentClient()->browser()->GetWebUIControllerFactory();
bool data_urls_allowed = delegate_ && delegate_->CanLoadDataURLsInWebUI();
bool is_allowed_in_web_ui_renderer =
- WebUIControllerFactoryRegistry::GetInstance()->IsURLAcceptableForWebUI(
- GetBrowserContext(), entry.GetURL(), data_urls_allowed);
+ factory &&
+ factory->IsURLAcceptableForWebUI(GetBrowserContext(), entry.GetURL(),
+ data_urls_allowed);
if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) &&
!is_allowed_in_web_ui_renderer) {
// Log the URL to help us diagnose any future failures of this CHECK.
@@ -1863,8 +1870,11 @@ int WebContentsImpl::GetContentRestrictions() const {
}
WebUI::TypeID WebContentsImpl::GetWebUITypeForCurrentState() {
- return WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType(
- GetBrowserContext(), GetURL());
+ WebUIControllerFactory* factory =
+ GetContentClient()->browser()->GetWebUIControllerFactory();
+ if (!factory)
+ return WebUI::kNoWebUI;
+ return factory->GetWebUIType(GetBrowserContext(), GetURL());
}
WebUI* WebContentsImpl::GetWebUIForCurrentState() {