| Index: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
| 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 d1794b4604b25950330fcf5c3bc853f55c8ca1d7..58456aaa07b64769a602d3b36fbee5b0f952ffb0 100644
|
| --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
| +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
| @@ -14,7 +14,6 @@
|
| #include "chrome/browser/about_flags.h"
|
| #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
|
| #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
|
| -#include "chrome/browser/extensions/extension_web_ui.h"
|
| #include "chrome/browser/favicon/favicon_service.h"
|
| #include "chrome/browser/history/history_types.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -28,8 +27,6 @@
|
| #include "chrome/browser/ui/webui/devtools_ui.h"
|
| #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h"
|
| #include "chrome/browser/ui/webui/downloads_ui.h"
|
| -#include "chrome/browser/ui/webui/extensions/extension_info_ui.h"
|
| -#include "chrome/browser/ui/webui/extensions/extensions_ui.h"
|
| #include "chrome/browser/ui/webui/flags_ui.h"
|
| #include "chrome/browser/ui/webui/flash_ui.h"
|
| #include "chrome/browser/ui/webui/gcm_internals_ui.h"
|
| @@ -57,7 +54,6 @@
|
| #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
|
| #include "chrome/browser/ui/webui/version_ui.h"
|
| #include "chrome/common/chrome_switches.h"
|
| -#include "chrome/common/extensions/extension_constants.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "components/dom_distiller/core/dom_distiller_constants.h"
|
| @@ -71,12 +67,6 @@
|
| #include "content/public/browser/web_ui.h"
|
| #include "content/public/common/content_client.h"
|
| #include "content/public/common/url_utils.h"
|
| -#include "extensions/browser/extension_registry.h"
|
| -#include "extensions/browser/extension_system.h"
|
| -#include "extensions/common/constants.h"
|
| -#include "extensions/common/extension.h"
|
| -#include "extensions/common/feature_switch.h"
|
| -#include "extensions/common/manifest.h"
|
| #include "ui/gfx/favicon_size.h"
|
| #include "ui/web_dialogs/web_dialog_ui.h"
|
| #include "url/gurl.h"
|
| @@ -162,7 +152,17 @@
|
| #endif
|
|
|
| #if defined(ENABLE_EXTENSIONS)
|
| +#include "chrome/browser/extensions/extension_web_ui.h"
|
| +#include "chrome/browser/ui/webui/extensions/extension_info_ui.h"
|
| +#include "chrome/browser/ui/webui/extensions/extensions_ui.h"
|
| #include "chrome/browser/ui/webui/voicesearch_ui.h"
|
| +#include "chrome/common/extensions/extension_constants.h"
|
| +#include "extensions/browser/extension_registry.h"
|
| +#include "extensions/browser/extension_system.h"
|
| +#include "extensions/common/constants.h"
|
| +#include "extensions/common/extension.h"
|
| +#include "extensions/common/feature_switch.h"
|
| +#include "extensions/common/manifest.h"
|
| #endif
|
|
|
| using content::WebUI;
|
| @@ -221,6 +221,7 @@ WebUIController* NewWebUI<dom_distiller::DomDistillerUi>(WebUI* web_ui,
|
| chrome::kDomDistillerScheme);
|
| }
|
|
|
| +#if defined(ENABLE_EXTENSIONS)
|
| // Only create ExtensionWebUI for URLs that are allowed extension bindings,
|
| // hosted by actual tabs.
|
| bool NeedsExtensionWebUI(Profile* profile, const GURL& url) {
|
| @@ -235,6 +236,7 @@ bool NeedsExtensionWebUI(Profile* profile, const GURL& url) {
|
| (!extension->is_hosted_app() ||
|
| extension->location() == extensions::Manifest::COMPONENT);
|
| }
|
| +#endif
|
|
|
| // Returns a function that can be used to create the right type of WebUI for a
|
| // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated
|
| @@ -562,11 +564,14 @@ bool ChromeWebUIControllerFactory::UseWebUIForURL(
|
|
|
| bool ChromeWebUIControllerFactory::UseWebUIBindingsForURL(
|
| content::BrowserContext* browser_context, const GURL& url) const {
|
| + bool needs_extensions_web_ui = false;
|
| +#if defined(ENABLE_EXTENSIONS)
|
| // Extensions are rendered via WebUI in tabs, but don't actually need WebUI
|
| // bindings (see the ExtensionWebUI constructor).
|
| - return
|
| - !NeedsExtensionWebUI(Profile::FromBrowserContext(browser_context), url) &&
|
| - UseWebUIForURL(browser_context, url);
|
| + needs_extensions_web_ui =
|
| + NeedsExtensionWebUI(Profile::FromBrowserContext(browser_context), url);
|
| +#endif
|
| + return !needs_extensions_web_ui && UseWebUIForURL(browser_context, url);
|
| }
|
|
|
| WebUIController* ChromeWebUIControllerFactory::CreateWebUIControllerForURL(
|
| @@ -589,20 +594,17 @@ void ChromeWebUIControllerFactory::GetFaviconForURL(
|
| // overrides. This changes urls in |kChromeUIScheme| to extension urls, and
|
| // allows to use ExtensionWebUI::GetFaviconForURL.
|
| GURL url(page_url);
|
| +#if defined(ENABLE_EXTENSIONS)
|
| ExtensionWebUI::HandleChromeURLOverride(&url, profile);
|
|
|
| // All extensions but the bookmark manager get their favicon from the icons
|
| // part of the manifest.
|
| if (url.SchemeIs(extensions::kExtensionScheme) &&
|
| url.host() != extension_misc::kBookmarkManagerId) {
|
| -#if defined(ENABLE_EXTENSIONS)
|
| ExtensionWebUI::GetFaviconForURL(profile, url, callback);
|
| -#else
|
| - RunFaviconCallbackAsync(
|
| - callback, new std::vector<favicon_base::FaviconRawBitmapResult>());
|
| -#endif
|
| return;
|
| }
|
| +#endif
|
|
|
| std::vector<favicon_base::FaviconRawBitmapResult>* favicon_bitmap_results =
|
| new std::vector<favicon_base::FaviconRawBitmapResult>();
|
|
|