Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: chrome/browser/tab_contents/tab_util.cc

Issue 434613003: Remove all the browser side extensions code from Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/tab_util.cc
diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc
index c6c0849bc89134177953a5701d1fb93b1ff23db9..219a1a4cce8456664af32fc15ef247f45c4c93ae 100644
--- a/chrome/browser/tab_contents/tab_util.cc
+++ b/chrome/browser/tab_contents/tab_util.cc
@@ -10,9 +10,12 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
-#include "extensions/browser/extension_registry.h"
#include "url/gurl.h"
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/browser/extension_registry.h"
+#endif
+
using content::RenderViewHost;
using content::SiteInstance;
using content::WebContents;
@@ -32,12 +35,14 @@ SiteInstance* GetSiteInstanceForNewTab(Profile* profile,
const GURL& url) {
// If |url| is a WebUI or extension, we set the SiteInstance up front so that
// we don't end up with an extra process swap on the first navigation.
- if (ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL(
- profile, url) ||
- extensions::ExtensionRegistry::Get(
- profile)->enabled_extensions().GetHostedAppByURL(url)) {
+ if (ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL(profile, url))
return SiteInstance::CreateForURL(profile, url);
- }
+
+#if defined(ENABLE_EXTENSIONS)
+ if (extensions::ExtensionRegistry::Get(
+ profile)->enabled_extensions().GetHostedAppByURL(url))
+ return SiteInstance::CreateForURL(profile, url);
+#endif
// We used to share the SiteInstance for same-site links opened in new tabs,
// to leverage the in-memory cache and reduce process creation. It now

Powered by Google App Engine
This is Rietveld 408576698