diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-09 05:52:50 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-09 05:52:50 +0000 |
commit | 6d8c5990e9c8f94c5a2544bf7f0c59f2a2f64e95 (patch) | |
tree | e394d625f43c6f673dba53f6900479ed07e30126 /chrome/browser/extensions/extension_system_factory.h | |
parent | 6c8bb0d63ec3b9ff1075c224144e4cafed6f7552 (diff) | |
download | chromium_src-6d8c5990e9c8f94c5a2544bf7f0c59f2a2f64e95.zip chromium_src-6d8c5990e9c8f94c5a2544bf7f0c59f2a2f64e95.tar.gz chromium_src-6d8c5990e9c8f94c5a2544bf7f0c59f2a2f64e95.tar.bz2 |
Reland 124817 - Take extensions out of Profile into a profile-keyed service, ExtensionSystem.
Move InitExtensions into ExtensionSystem.
Remove a few accessors (ExtensionDevToolsManager, ExtensionMessageService). The others have too many callers to fix in one go.
New: PrerenderManagerFactory DependsOn ExtensionSystemFactory.
BUG=104095
TEST=Open and close an incognito window; should not crash.
TBR=aa@chromium.org,akalin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9609024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_system_factory.h')
-rw-r--r-- | chrome/browser/extensions/extension_system_factory.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_system_factory.h b/chrome/browser/extensions/extension_system_factory.h new file mode 100644 index 0000000..a6c0c9e --- /dev/null +++ b/chrome/browser/extensions/extension_system_factory.h @@ -0,0 +1,56 @@ +// Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ +#pragma once + +#include "base/memory/singleton.h" +#include "chrome/browser/extensions/extension_system.h" +#include "chrome/browser/profiles/profile_keyed_service_factory.h" + +class ExtensionSystem; +class Profile; +class ProfileKeyedService; + +// ProfileKeyedServiceFactory for ExtensionSystemImpl::Shared. +// Should not be used except by ExtensionSystem(Factory). +class ExtensionSystemSharedFactory : public ProfileKeyedServiceFactory { + public: + static ExtensionSystemImpl::Shared* GetForProfile(Profile* profile); + + static ExtensionSystemSharedFactory* GetInstance(); + + private: + friend struct DefaultSingletonTraits<ExtensionSystemSharedFactory>; + + ExtensionSystemSharedFactory(); + virtual ~ExtensionSystemSharedFactory(); + + virtual ProfileKeyedService* BuildServiceInstanceFor( + Profile* profile) const OVERRIDE; + virtual bool ServiceRedirectedInIncognito() OVERRIDE; +}; + +// ProfileKeyedServiceFactory for ExtensionSystem. +class ExtensionSystemFactory : public ProfileKeyedServiceFactory { + public: + // ProfileKeyedServiceFactory implementation: + static ExtensionSystem* GetForProfile(Profile* profile); + + static ExtensionSystemFactory* GetInstance(); + + private: + friend struct DefaultSingletonTraits<ExtensionSystemFactory>; + + ExtensionSystemFactory(); + virtual ~ExtensionSystemFactory(); + + virtual ProfileKeyedService* BuildServiceInstanceFor( + Profile* profile) const OVERRIDE; + virtual bool ServiceHasOwnInstanceInIncognito() OVERRIDE; + virtual bool ServiceIsCreatedWithProfile() OVERRIDE; +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ |