#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
#include "extensions/browser/extension_system.h"
#include "extensions/common/one_shot_event.h"
class Profile;
namespace extensions {
class ExtensionSystemSharedFactory;
class ExtensionWarningBadgeService;
class NavigationObserver;
class StandardManagementPolicyProvider;
class ExtensionSystemImpl : public ExtensionSystem {
public:
explicit ExtensionSystemImpl(Profile* profile);
virtual ~ExtensionSystemImpl();
virtual void Shutdown() OVERRIDE;
virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE;
virtual ExtensionService* extension_service() OVERRIDE;
virtual RuntimeData* runtime_data() OVERRIDE;
virtual ManagementPolicy* management_policy() OVERRIDE;
virtual UserScriptMaster* user_script_master() OVERRIDE;
virtual ProcessManager* process_manager() OVERRIDE;
virtual StateStore* state_store() OVERRIDE;
virtual StateStore* rules_store() OVERRIDE;
virtual LazyBackgroundTaskQueue* lazy_background_task_queue()
OVERRIDE;
virtual InfoMap* info_map() OVERRIDE;
virtual EventRouter* event_router() OVERRIDE;
virtual ExtensionWarningService* warning_service() OVERRIDE;
virtual Blacklist* blacklist() OVERRIDE;
virtual ErrorConsole* error_console() OVERRIDE;
virtual InstallVerifier* install_verifier() OVERRIDE;
virtual QuotaService* quota_service() OVERRIDE;
virtual void RegisterExtensionWithRequestContexts(
const Extension* extension) OVERRIDE;
virtual void UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionInfo::Reason reason) OVERRIDE;
virtual const OneShotEvent& ready() const OVERRIDE;
private:
friend class ExtensionSystemSharedFactory;
class Shared : public KeyedService {
public:
explicit Shared(Profile* profile);
virtual ~Shared();
virtual void InitPrefs();
void RegisterManagementPolicyProviders();
void Init(bool extensions_enabled);
virtual void Shutdown() OVERRIDE;
StateStore* state_store();
StateStore* rules_store();
ExtensionService* extension_service();
RuntimeData* runtime_data();
ManagementPolicy* management_policy();
UserScriptMaster* user_script_master();
Blacklist* blacklist();
InfoMap* info_map();
LazyBackgroundTaskQueue* lazy_background_task_queue();
EventRouter* event_router();
ExtensionWarningService* warning_service();
ErrorConsole* error_console();
InstallVerifier* install_verifier();
QuotaService* quota_service();
const OneShotEvent& ready() const { return ready_; }
private:
Profile* profile_;
scoped_ptr<StateStore> state_store_;
scoped_ptr<StateStore> rules_store_;
scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
scoped_ptr<EventRouter> event_router_;
scoped_ptr<NavigationObserver> navigation_observer_;
scoped_refptr<UserScriptMaster> user_script_master_;
scoped_ptr<Blacklist> blacklist_;
scoped_ptr<StandardManagementPolicyProvider>
standard_management_policy_provider_;
scoped_ptr<RuntimeData> runtime_data_;
scoped_ptr<ExtensionService> extension_service_;
scoped_ptr<ManagementPolicy> management_policy_;
scoped_refptr<InfoMap> extension_info_map_;
scoped_ptr<ExtensionWarningService> extension_warning_service_;
scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_;
scoped_ptr<ErrorConsole> error_console_;
scoped_ptr<InstallVerifier> install_verifier_;
scoped_ptr<QuotaService> quota_service_;
#if defined(OS_CHROMEOS)
scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider>
device_local_account_management_policy_provider_;
#endif
OneShotEvent ready_;
};
Profile* profile_;
Shared* shared_;
scoped_ptr<ProcessManager> process_manager_;
DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl);
};
}
#endif