diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-07 03:45:58 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-07 03:45:58 +0000 |
commit | da762a83c3a3bdc03d5bf70cdd15801feb9dff62 (patch) | |
tree | 6f7894e30d8de920b4bc8d864e76e0127e94cf1c | |
parent | 7eb7dc48d05847d7dcd2165d19562cbb11eaa201 (diff) | |
download | chromium_src-da762a83c3a3bdc03d5bf70cdd15801feb9dff62.zip chromium_src-da762a83c3a3bdc03d5bf70cdd15801feb9dff62.tar.gz chromium_src-da762a83c3a3bdc03d5bf70cdd15801feb9dff62.tar.bz2 |
Add ExtensionsBrowserClient and AppSorting to app_shell
This lets it run a little further when attempting to run an app.
BUG=None
TEST=None
Review URL: https://codereview.chromium.org/106033002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239311 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | apps/app_load_service_factory.cc | 6 | ||||
-rw-r--r-- | apps/apps.gypi | 4 | ||||
-rw-r--r-- | apps/shell/DEPS | 1 | ||||
-rw-r--r-- | apps/shell/app_shell_app_sorting.cc | 107 | ||||
-rw-r--r-- | apps/shell/app_shell_app_sorting.h | 64 | ||||
-rw-r--r-- | apps/shell/app_shell_browser_context.cc | 23 | ||||
-rw-r--r-- | apps/shell/app_shell_browser_context.h | 4 | ||||
-rw-r--r-- | apps/shell/app_shell_browser_main_parts.cc | 10 | ||||
-rw-r--r-- | apps/shell/app_shell_browser_main_parts.h | 2 | ||||
-rw-r--r-- | apps/shell/app_shell_extensions_browser_client.cc | 108 | ||||
-rw-r--r-- | apps/shell/app_shell_extensions_browser_client.h | 57 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_system_factory.cc | 9 | ||||
-rw-r--r-- | extensions/browser/app_sorting.h | 4 |
13 files changed, 363 insertions, 36 deletions
diff --git a/apps/app_load_service_factory.cc b/apps/app_load_service_factory.cc index a68cf94..a296d34 100644 --- a/apps/app_load_service_factory.cc +++ b/apps/app_load_service_factory.cc @@ -8,9 +8,9 @@ #include "apps/shell_window_registry.h" #include "chrome/browser/extensions/extension_prefs_factory.h" #include "chrome/browser/extensions/extension_system_factory.h" -#include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "extensions/browser/extensions_browser_client.h" namespace apps { @@ -51,7 +51,9 @@ bool AppLoadServiceFactory::ServiceIsCreatedWithBrowserContext() const { content::BrowserContext* AppLoadServiceFactory::GetBrowserContextToUse( content::BrowserContext* context) const { - return chrome::GetBrowserContextRedirectedInIncognito(context); + // Redirected in incognito. + return extensions::ExtensionsBrowserClient::Get()-> + GetOriginalContext(context); } } // namespace apps diff --git a/apps/apps.gypi b/apps/apps.gypi index e26ea5d..d424e8e7 100644 --- a/apps/apps.gypi +++ b/apps/apps.gypi @@ -122,6 +122,8 @@ '..', ], 'sources': [ + 'shell/app_shell_app_sorting.cc', + 'shell/app_shell_app_sorting.h', 'shell/app_shell_browser_context.cc', 'shell_app_shell_browser_context.h', 'shell/app_shell_browser_main_parts.cc', @@ -130,6 +132,8 @@ 'shell/app_shell_content_browser_client.h', 'shell/app_shell_content_client.cc', 'shell/app_shell_content_client.h', + 'shell/app_shell_extensions_browser_client.cc', + 'shell/app_shell_extensions_browser_client.h', 'shell/app_shell_main_delegate.cc', 'shell/app_shell_main_delegate.h', 'shell/app_shell_main.cc', diff --git a/apps/shell/DEPS b/apps/shell/DEPS index 55c7e28..38fd058 100644 --- a/apps/shell/DEPS +++ b/apps/shell/DEPS @@ -2,6 +2,7 @@ include_rules = [ "-chrome", "+chromeos", "+components/user_prefs", + "+sync/api", "+ui/shell", "+webkit/common/user_agent/user_agent_util.h", diff --git a/apps/shell/app_shell_app_sorting.cc b/apps/shell/app_shell_app_sorting.cc new file mode 100644 index 0000000..a130d1b --- /dev/null +++ b/apps/shell/app_shell_app_sorting.cc @@ -0,0 +1,107 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "apps/shell/app_shell_app_sorting.h" + +#include "sync/api/string_ordinal.h" + +namespace { + +// Ordinals for a single app on a single page. +const char kFirstApp[] = "a"; +const char kNextApp[] = "b"; +const char kFirstPage[] = "a"; + +} // namespace + +namespace apps { + +AppShellAppSorting::AppShellAppSorting() { +} + +AppShellAppSorting::~AppShellAppSorting() { +} + +void AppShellAppSorting::SetExtensionScopedPrefs( + extensions::ExtensionScopedPrefs* prefs) { +} + +void AppShellAppSorting::SetExtensionSyncService( + ExtensionSyncService* extension_sync_service) { +} + +void AppShellAppSorting::Initialize( + const extensions::ExtensionIdList& extension_ids) { +} + +void AppShellAppSorting::FixNTPOrdinalCollisions() { +} + +void AppShellAppSorting::EnsureValidOrdinals( + const std::string& extension_id, + const syncer::StringOrdinal& suggested_page) { +} + +void AppShellAppSorting::OnExtensionMoved( + const std::string& moved_extension_id, + const std::string& predecessor_extension_id, + const std::string& successor_extension_id) { +} + +syncer::StringOrdinal AppShellAppSorting::GetAppLaunchOrdinal( + const std::string& extension_id) const { + return syncer::StringOrdinal(kFirstApp); +} + +void AppShellAppSorting::SetAppLaunchOrdinal( + const std::string& extension_id, + const syncer::StringOrdinal& new_app_launch_ordinal) { +} + +syncer::StringOrdinal AppShellAppSorting::CreateFirstAppLaunchOrdinal( + const syncer::StringOrdinal& page_ordinal) const { + return syncer::StringOrdinal(kFirstApp); +} + +syncer::StringOrdinal AppShellAppSorting::CreateNextAppLaunchOrdinal( + const syncer::StringOrdinal& page_ordinal) const { + return syncer::StringOrdinal(kNextApp); +} + +syncer::StringOrdinal AppShellAppSorting::CreateFirstAppPageOrdinal() const { + return syncer::StringOrdinal(kFirstPage); +} + +syncer::StringOrdinal AppShellAppSorting::GetNaturalAppPageOrdinal() const { + return syncer::StringOrdinal(kFirstPage); +} + +syncer::StringOrdinal AppShellAppSorting::GetPageOrdinal( + const std::string& extension_id) const { + return syncer::StringOrdinal(kFirstPage); +} + +void AppShellAppSorting::SetPageOrdinal( + const std::string& extension_id, + const syncer::StringOrdinal& new_page_ordinal) { +} + +void AppShellAppSorting::ClearOrdinals(const std::string& extension_id) { +} + +int AppShellAppSorting::PageStringOrdinalAsInteger( + const syncer::StringOrdinal& page_ordinal) const { + return 0; +} + +syncer::StringOrdinal AppShellAppSorting::PageIntegerAsStringOrdinal( + size_t page_index) { + return syncer::StringOrdinal(kFirstPage); +} + +void AppShellAppSorting::MarkExtensionAsHidden( + const std::string& extension_id) { +} + +} // namespace apps diff --git a/apps/shell/app_shell_app_sorting.h b/apps/shell/app_shell_app_sorting.h new file mode 100644 index 0000000..d619aa8 --- /dev/null +++ b/apps/shell/app_shell_app_sorting.h @@ -0,0 +1,64 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef APPS_SHELL_APP_SHELL_APP_SORTING_H_ +#define APPS_SHELL_APP_SHELL_APP_SORTING_H_ + +#include "base/compiler_specific.h" +#include "extensions/browser/app_sorting.h" + +namespace apps { + +// A stub AppSorting. Since app_shell only runs a single app we don't need to +// sort them. +class AppShellAppSorting : public extensions::AppSorting { + public: + AppShellAppSorting(); + virtual ~AppShellAppSorting(); + + // extensions::AppSorting overrides: + virtual void SetExtensionScopedPrefs(extensions::ExtensionScopedPrefs* prefs) + OVERRIDE; + virtual void SetExtensionSyncService( + ExtensionSyncService* extension_sync_service) OVERRIDE; + virtual void Initialize( + const extensions::ExtensionIdList& extension_ids) OVERRIDE; + virtual void FixNTPOrdinalCollisions() OVERRIDE; + virtual void EnsureValidOrdinals( + const std::string& extension_id, + const syncer::StringOrdinal& suggested_page) OVERRIDE; + virtual void OnExtensionMoved( + const std::string& moved_extension_id, + const std::string& predecessor_extension_id, + const std::string& successor_extension_id) OVERRIDE; + virtual syncer::StringOrdinal GetAppLaunchOrdinal( + const std::string& extension_id) const OVERRIDE; + virtual void SetAppLaunchOrdinal( + const std::string& extension_id, + const syncer::StringOrdinal& new_app_launch_ordinal) OVERRIDE; + virtual syncer::StringOrdinal CreateFirstAppLaunchOrdinal( + const syncer::StringOrdinal& page_ordinal) const OVERRIDE; + virtual syncer::StringOrdinal CreateNextAppLaunchOrdinal( + const syncer::StringOrdinal& page_ordinal) const OVERRIDE; + virtual syncer::StringOrdinal CreateFirstAppPageOrdinal() const OVERRIDE; + virtual syncer::StringOrdinal GetNaturalAppPageOrdinal() const OVERRIDE; + virtual syncer::StringOrdinal GetPageOrdinal( + const std::string& extension_id) const OVERRIDE; + virtual void SetPageOrdinal( + const std::string& extension_id, + const syncer::StringOrdinal& new_page_ordinal) OVERRIDE; + virtual void ClearOrdinals(const std::string& extension_id) OVERRIDE; + virtual int PageStringOrdinalAsInteger( + const syncer::StringOrdinal& page_ordinal) const OVERRIDE; + virtual syncer::StringOrdinal PageIntegerAsStringOrdinal( + size_t page_index) OVERRIDE; + virtual void MarkExtensionAsHidden(const std::string& extension_id) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(AppShellAppSorting); +}; + +} // namespace apps + +#endif // APPS_SHELL_APP_SHELL_APP_SORTING_H_ diff --git a/apps/shell/app_shell_browser_context.cc b/apps/shell/app_shell_browser_context.cc index e95fa75..f85697d 100644 --- a/apps/shell/app_shell_browser_context.cc +++ b/apps/shell/app_shell_browser_context.cc @@ -5,11 +5,6 @@ #include "apps/shell/app_shell_browser_context.h" #include "apps/app_load_service_factory.h" -#include "base/prefs/pref_service.h" -#include "base/prefs/pref_service_factory.h" -#include "base/prefs/testing_pref_store.h" -#include "components/user_prefs/pref_registry_syncable.h" -#include "components/user_prefs/user_prefs.h" namespace { @@ -18,11 +13,6 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() { apps::AppLoadServiceFactory::GetInstance(); } -// See chrome::RegisterProfilePrefs() in chrome/browser/prefs/browser_prefs.cc -void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) { - // TODO(jamescook): ExtensionPrefs::RegisterProfilePrefs(registry) -} - } // namespace namespace apps { @@ -33,19 +23,6 @@ namespace apps { AppShellBrowserContext::AppShellBrowserContext() : content::ShellBrowserContext(false, NULL) { EnsureBrowserContextKeyedServiceFactoriesBuilt(); - - base::PrefServiceFactory factory; - factory.set_user_prefs(new TestingPrefStore); - factory.set_extension_prefs(new TestingPrefStore); - // app_shell should not require syncable preferences, but for now we need to - // recycle some of the RegisterProfilePrefs() code in Chrome. - // TODO(jamescook): Convert this to user_prefs::PrefRegistrySimple. - user_prefs::PrefRegistrySyncable* pref_registry = - new user_prefs::PrefRegistrySyncable; - // Prefs should be registered before the PrefService is created. - RegisterPrefs(pref_registry); - prefs_ = factory.Create(pref_registry).Pass(); - user_prefs::UserPrefs::Set(this, prefs_.get()); } AppShellBrowserContext::~AppShellBrowserContext() { diff --git a/apps/shell/app_shell_browser_context.h b/apps/shell/app_shell_browser_context.h index 3a12679..ecde105a 100644 --- a/apps/shell/app_shell_browser_context.h +++ b/apps/shell/app_shell_browser_context.h @@ -8,8 +8,6 @@ #include "base/compiler_specific.h" #include "content/shell/browser/shell_browser_context.h" -class PrefService; - namespace apps { // The BrowserContext used by the content, apps and extensions systems in @@ -32,8 +30,6 @@ class AppShellBrowserContext : public content::ShellBrowserContext { virtual void ProfileFunctionCallOnNonProfileBrowserContext9(); private: - scoped_ptr<PrefService> prefs_; - DISALLOW_COPY_AND_ASSIGN(AppShellBrowserContext); }; diff --git a/apps/shell/app_shell_browser_main_parts.cc b/apps/shell/app_shell_browser_main_parts.cc index 1cc9456..7526bcf 100644 --- a/apps/shell/app_shell_browser_main_parts.cc +++ b/apps/shell/app_shell_browser_main_parts.cc @@ -6,6 +6,7 @@ #include "apps/app_load_service.h" #include "apps/shell/app_shell_browser_context.h" +#include "apps/shell/app_shell_extensions_browser_client.h" #include "apps/shell/web_view_window.h" #include "base/command_line.h" #include "base/file_util.h" @@ -93,11 +94,14 @@ void AppShellBrowserMainParts::PreMainMessageLoopRun() { // TODO(jamescook): Initialize chromeos::UserManager. - // TODO(jamescook): Initialize ExtensionsClient and ExtensionsBrowserClient. - // Initialize our "profile" equivalent. browser_context_.reset(new AppShellBrowserContext); + // TODO(jamescook): Initialize ExtensionsClient. + extensions_browser_client_.reset( + new AppShellExtensionsBrowserClient(browser_context_.get())); + extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); + // TODO(jamescook): Initialize policy::ProfilePolicyConnector. // TODO(jamescook): Initialize ExtensionSystem and InitForRegularProfile. // TODO(jamescook): CreateBrowserContextServices using @@ -127,6 +131,8 @@ bool AppShellBrowserMainParts::MainMessageLoopRun(int* result_code) { } void AppShellBrowserMainParts::PostMainMessageLoopRun() { + extensions::ExtensionsBrowserClient::Set(NULL); + extensions_browser_client_.reset(); browser_context_.reset(); wm_test_helper_.reset(); aura::Env::DeleteInstance(); diff --git a/apps/shell/app_shell_browser_main_parts.h b/apps/shell/app_shell_browser_main_parts.h index f8b05c3..5300d31 100644 --- a/apps/shell/app_shell_browser_main_parts.h +++ b/apps/shell/app_shell_browser_main_parts.h @@ -30,6 +30,7 @@ class WMTestHelper; namespace apps { class AppShellBrowserContext; +class AppShellExtensionsBrowserClient; // Handles initialization of AppShell. class AppShellBrowserMainParts : public content::BrowserMainParts { @@ -59,6 +60,7 @@ class AppShellBrowserMainParts : public content::BrowserMainParts { private: scoped_ptr<AppShellBrowserContext> browser_context_; + scoped_ptr<AppShellExtensionsBrowserClient> extensions_browser_client_; // Enable a minimal set of views::corewm to be initialized. scoped_ptr<wm::WMTestHelper> wm_test_helper_; diff --git a/apps/shell/app_shell_extensions_browser_client.cc b/apps/shell/app_shell_extensions_browser_client.cc new file mode 100644 index 0000000..aee9ac6 --- /dev/null +++ b/apps/shell/app_shell_extensions_browser_client.cc @@ -0,0 +1,108 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "apps/shell/app_shell_extensions_browser_client.h" + +#include "apps/shell/app_shell_app_sorting.h" +#include "base/prefs/pref_service.h" +#include "base/prefs/pref_service_factory.h" +#include "base/prefs/testing_pref_store.h" +#include "components/user_prefs/pref_registry_syncable.h" +#include "components/user_prefs/user_prefs.h" +#include "extensions/browser/app_sorting.h" + +using content::BrowserContext; + +namespace { + +// See chrome::RegisterProfilePrefs() in chrome/browser/prefs/browser_prefs.cc +void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) { + // TODO(jamescook): ExtensionPrefs::RegisterProfilePrefs(registry) +} + +} // namespace + +namespace apps { + +AppShellExtensionsBrowserClient::AppShellExtensionsBrowserClient( + BrowserContext* context) + : browser_context_(context) { + // Set up the preferences service. + base::PrefServiceFactory factory; + factory.set_user_prefs(new TestingPrefStore); + factory.set_extension_prefs(new TestingPrefStore); + // app_shell should not require syncable preferences, but for now we need to + // recycle some of the RegisterProfilePrefs() code in Chrome. + // TODO(jamescook): Convert this to user_prefs::PrefRegistrySimple. + user_prefs::PrefRegistrySyncable* pref_registry = + new user_prefs::PrefRegistrySyncable; + // Prefs should be registered before the PrefService is created. + RegisterPrefs(pref_registry); + prefs_ = factory.Create(pref_registry).Pass(); + user_prefs::UserPrefs::Set(browser_context_, prefs_.get()); +} + +AppShellExtensionsBrowserClient::~AppShellExtensionsBrowserClient() {} + +bool AppShellExtensionsBrowserClient::IsShuttingDown() { + return false; +} + +bool AppShellExtensionsBrowserClient::AreExtensionsDisabled( + const CommandLine& command_line, + BrowserContext* context) { + return false; +} + +bool AppShellExtensionsBrowserClient::IsValidContext(BrowserContext* context) { + return context == browser_context_; +} + +bool AppShellExtensionsBrowserClient::IsSameContext(BrowserContext* first, + BrowserContext* second) { + return first == second; +} + +bool AppShellExtensionsBrowserClient::HasOffTheRecordContext( + BrowserContext* context) { + return false; +} + +BrowserContext* AppShellExtensionsBrowserClient::GetOffTheRecordContext( + BrowserContext* context) { + // app_shell only supports a single context. + return NULL; +} + +BrowserContext* AppShellExtensionsBrowserClient::GetOriginalContext( + BrowserContext* context) { + return context; +} + +PrefService* AppShellExtensionsBrowserClient::GetPrefServiceForContext( + BrowserContext* context) { + return prefs_.get(); +} + +bool AppShellExtensionsBrowserClient::DeferLoadingBackgroundHosts( + BrowserContext* context) const { + return false; +} + +bool AppShellExtensionsBrowserClient::DidVersionUpdate( + BrowserContext* context) { + // TODO(jamescook): We might want to tell extensions when app_shell updates. + return false; +} + +scoped_ptr<extensions::AppSorting> +AppShellExtensionsBrowserClient::CreateAppSorting() { + return scoped_ptr<extensions::AppSorting>(new AppShellAppSorting).Pass(); +} + +bool AppShellExtensionsBrowserClient::IsRunningInForcedAppMode() { + return false; +} + +} // namespace apps diff --git a/apps/shell/app_shell_extensions_browser_client.h b/apps/shell/app_shell_extensions_browser_client.h new file mode 100644 index 0000000..564a40d --- /dev/null +++ b/apps/shell/app_shell_extensions_browser_client.h @@ -0,0 +1,57 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef APPS_SHELL_APP_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ +#define APPS_SHELL_APP_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ + +#include "base/compiler_specific.h" +#include "extensions/browser/extensions_browser_client.h" + +class PrefService; + +namespace apps { + +// An ExtensionsBrowserClient that supports a single content::BrowserContent +// with no related incognito context. +class AppShellExtensionsBrowserClient + : public extensions::ExtensionsBrowserClient { + public: + // |context| is the single BrowserContext used for IsValidContext() below. + explicit AppShellExtensionsBrowserClient(content::BrowserContext* context); + virtual ~AppShellExtensionsBrowserClient(); + + // extensions::ExtensionsBrowserClient overrides: + virtual bool IsShuttingDown() OVERRIDE; + virtual bool AreExtensionsDisabled(const CommandLine& command_line, + content::BrowserContext* context) OVERRIDE; + virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; + virtual bool IsSameContext(content::BrowserContext* first, + content::BrowserContext* second) OVERRIDE; + virtual bool HasOffTheRecordContext(content::BrowserContext* context) + OVERRIDE; + virtual content::BrowserContext* GetOffTheRecordContext( + content::BrowserContext* context) OVERRIDE; + virtual content::BrowserContext* GetOriginalContext( + content::BrowserContext* context) OVERRIDE; + virtual PrefService* GetPrefServiceForContext( + content::BrowserContext* context) OVERRIDE; + virtual bool DeferLoadingBackgroundHosts(content::BrowserContext* context) + const OVERRIDE; + virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; + virtual scoped_ptr<extensions::AppSorting> CreateAppSorting() OVERRIDE; + virtual bool IsRunningInForcedAppMode() OVERRIDE; + + private: + // The single BrowserContext for app_shell. Not owned. + content::BrowserContext* browser_context_; + + // The PrefService for |browser_context_|. + scoped_ptr<PrefService> prefs_; + + DISALLOW_COPY_AND_ASSIGN(AppShellExtensionsBrowserClient); +}; + +} // namespace apps + +#endif // APPS_SHELL_APP_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ diff --git a/chrome/browser/extensions/extension_system_factory.cc b/chrome/browser/extensions/extension_system_factory.cc index 617192f..8bb0e0d 100644 --- a/chrome/browser/extensions/extension_system_factory.cc +++ b/chrome/browser/extensions/extension_system_factory.cc @@ -7,10 +7,10 @@ #include "chrome/browser/extensions/extension_prefs_factory.h" #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/policy/profile_policy_connector_factory.h" -#include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "extensions/browser/extensions_browser_client.h" namespace extensions { @@ -48,7 +48,9 @@ ExtensionSystemSharedFactory::BuildServiceInstanceFor( content::BrowserContext* ExtensionSystemSharedFactory::GetBrowserContextToUse( content::BrowserContext* context) const { - return chrome::GetBrowserContextRedirectedInIncognito(context); + // Redirected in incognito. + return extensions::ExtensionsBrowserClient::Get()-> + GetOriginalContext(context); } // ExtensionSystemFactory @@ -81,7 +83,8 @@ BrowserContextKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( content::BrowserContext* context) const { - return chrome::GetBrowserContextOwnInstanceInIncognito(context); + // Separate instance in incognito. + return context; } bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { diff --git a/extensions/browser/app_sorting.h b/extensions/browser/app_sorting.h index 6efa5e4..967fb46 100644 --- a/extensions/browser/app_sorting.h +++ b/extensions/browser/app_sorting.h @@ -8,15 +8,15 @@ #include <string> #include "base/basictypes.h" -#include "chrome/browser/extensions/extension_prefs.h" #include "extensions/common/extension.h" #include "sync/api/string_ordinal.h" -class ExtensionScopedPrefs; class ExtensionSyncService; namespace extensions { +class ExtensionScopedPrefs; + // An interface that provides a fixed ordering for a set of apps. class AppSorting { public: |