summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-10 01:42:31 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-10 01:42:31 +0000
commitd6ef7684df0f0699bbeb5baceb69998fecd2c36d (patch)
tree986df4b654309cfabefbc778bd2f8665b3d8b5ba /chrome
parentbd132983c14c2bc63098578027c9596b397f9f4e (diff)
downloadchromium_src-d6ef7684df0f0699bbeb5baceb69998fecd2c36d.zip
chromium_src-d6ef7684df0f0699bbeb5baceb69998fecd2c36d.tar.gz
chromium_src-d6ef7684df0f0699bbeb5baceb69998fecd2c36d.tar.bz2
Revert 175890: actually, looks like we want this to also help move chromeos webui pages out of src/chrome.
> 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 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/11819050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_browser_main.cc4
-rw-r--r--chrome/browser/chrome_content_browser_client.cc5
-rw-r--r--chrome/browser/chrome_content_browser_client.h1
-rw-r--r--chrome/browser/extensions/api/debugger/debugger_api.cc4
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc9
-rw-r--r--chrome/common/chrome_content_client.cc6
-rw-r--r--chrome/common/chrome_content_client.h1
-rw-r--r--chrome/common/chrome_content_client_ios.mm4
-rw-r--r--chrome/test/base/chrome_test_suite.cc12
9 files changed, 23 insertions, 23 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 07e9876..25a7a4c 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -92,6 +92,7 @@
#include "chrome/browser/ui/uma_browsing_activity_observer.h"
#include "chrome/browser/ui/user_data_dir_dialog.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
+#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
@@ -1391,6 +1392,9 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
g_browser_process->profile_manager()->GetLastOpenedProfiles();
#endif
+ content::WebUIControllerFactory::RegisterFactory(
+ ChromeWebUIControllerFactory::GetInstance());
+
if (browser_creator_->Start(parsed_command_line(), FilePath(),
profile_, last_opened_profiles, &result_code)) {
#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 53ab0ed..475e3cd 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -625,11 +625,6 @@ void ChromeContentBrowserClient::RenderProcessHostCreated(
#endif
}
-content::WebUIControllerFactory*
- ChromeContentBrowserClient::GetWebUIControllerFactory() {
- return ChromeWebUIControllerFactory::GetInstance();
-}
-
GURL ChromeContentBrowserClient::GetEffectiveURL(
content::BrowserContext* browser_context, const GURL& url) {
Profile* profile = Profile::FromBrowserContext(browser_context);
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index 468bd3b..3113f6e 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -62,7 +62,6 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void RenderProcessHostCreated(
content::RenderProcessHost* host) OVERRIDE;
- virtual content::WebUIControllerFactory* GetWebUIControllerFactory() OVERRIDE;
virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) OVERRIDE;
virtual GURL GetEffectiveURL(content::BrowserContext* browser_context,
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index 79b28b7..2342691 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -36,6 +36,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/url_constants.h"
#include "extensions/common/error_utils.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -428,8 +429,7 @@ bool DebuggerFunction::InitWebContents() {
}
contents_ = web_contents;
- if (content::GetContentClient()->HasWebUIScheme(
- contents_->GetURL())) {
+ if (content::HasWebUIScheme(contents_->GetURL())) {
error_ = ErrorUtils::FormatErrorMessage(
keys::kAttachToWebUIError,
contents_->GetURL().scheme());
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 7b44b6b..f76498f 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -35,9 +35,6 @@
#include "chrome/browser/ui/webui/instant_ui.h"
#include "chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.h"
#include "chrome/browser/ui/webui/media/media_internals_ui.h"
-#if !defined(DISABLE_NACL)
-#include "chrome/browser/ui/webui/nacl_ui.h"
-#endif
#include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/omnibox/omnibox_ui.h"
@@ -68,6 +65,10 @@
#include "ui/gfx/favicon_size.h"
#include "ui/web_dialogs/web_dialog_ui.h"
+#if !defined(DISABLE_NACL)
+#include "chrome/browser/ui/webui/nacl_ui.h"
+#endif
+
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/ui/webui/policy_ui.h"
#endif
@@ -583,7 +584,7 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
}
#endif
- if (!content::GetContentClient()->HasWebUIScheme(page_url))
+ if (!content::HasWebUIScheme(page_url))
return NULL;
#if defined(OS_WIN)
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 577498b..2a70d88 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -386,12 +386,6 @@ void ChromeContentClient::AddAdditionalSchemes(
#endif
}
-bool ChromeContentClient::HasWebUIScheme(const GURL& url) const {
- return url.SchemeIs(chrome::kChromeDevToolsScheme) ||
- url.SchemeIs(chrome::kChromeInternalScheme) ||
- url.SchemeIs(chrome::kChromeUIScheme);
-}
-
bool ChromeContentClient::CanHandleWhileSwappedOut(
const IPC::Message& msg) {
// Any Chrome-specific messages (apart from those listed in
diff --git a/chrome/common/chrome_content_client.h b/chrome/common/chrome_content_client.h
index de0b960..96762ce 100644
--- a/chrome/common/chrome_content_client.h
+++ b/chrome/common/chrome_content_client.h
@@ -28,7 +28,6 @@ class ChromeContentClient : public content::ContentClient {
virtual void AddAdditionalSchemes(
std::vector<std::string>* standard_schemes,
std::vector<std::string>* saveable_shemes) OVERRIDE;
- virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE;
virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg) OVERRIDE;
virtual std::string GetProduct() const OVERRIDE;
virtual std::string GetUserAgent() const OVERRIDE;
diff --git a/chrome/common/chrome_content_client_ios.mm b/chrome/common/chrome_content_client_ios.mm
index c8b086e..1ebe282 100644
--- a/chrome/common/chrome_content_client_ios.mm
+++ b/chrome/common/chrome_content_client_ios.mm
@@ -42,10 +42,6 @@ void ChromeContentClient::AddAdditionalSchemes(
// No additional schemes for iOS.
}
-bool ChromeContentClient::HasWebUIScheme(const GURL& url) const {
- return url.SchemeIs(chrome::kChromeUIScheme);
-}
-
bool ChromeContentClient::CanHandleWhileSwappedOut(
const IPC::Message& msg) {
NOTIMPLEMENTED();
diff --git a/chrome/test/base/chrome_test_suite.cc b/chrome/test/base/chrome_test_suite.cc
index a1791ae..5f6a07a 100644
--- a/chrome/test/base/chrome_test_suite.cc
+++ b/chrome/test/base/chrome_test_suite.cc
@@ -19,11 +19,13 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_content_browser_client.h"
+#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/testing_browser_process.h"
+#include "content/public/test/test_launcher.h"
#include "net/base/mock_host_resolver.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
@@ -211,6 +213,16 @@ void ChromeTestSuite::Initialize() {
PathService::Override(base::DIR_MODULE, browser_dir_);
}
+#if !defined(OS_IOS)
+ if (!content::GetCurrentTestLauncherDelegate()) {
+ // Only want to do this for unit tests. For browser tests, this won't create
+ // the right object since TestChromeWebUIControllerFactory is used. That's
+ // created and registered in ChromeBrowserMainParts as in normal startup.
+ content::WebUIControllerFactory::RegisterFactory(
+ ChromeWebUIControllerFactory::GetInstance());
+ }
+#endif
+
// Disable external libraries load if we are under python process in
// ChromeOS. That means we are autotest and, if ASAN is used,
// external libraries load crashes.