1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
6 #define APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
10 #include "base/compiler_specific.h"
11 #include "extensions/browser/extension_system.h"
12 #include "extensions/common/one_shot_event.h"
14 class BrowserContextKeyedServiceFactory;
24 namespace extensions {
28 class LazyBackgroundTaskQueue;
30 class RendererStartupHelper;
32 // A simplified version of ExtensionSystem for app_shell. Allows
33 // app_shell to skip initialization of services it doesn't need.
34 class ShellExtensionSystem : public ExtensionSystem {
36 explicit ShellExtensionSystem(content::BrowserContext* browser_context);
37 virtual ~ShellExtensionSystem();
39 // Loads an unpacked application from a directory and attempts to launch it.
40 // Returns true on success.
41 bool LoadAndLaunchApp(const base::FilePath& app_dir);
43 // BrowserContextKeyedService implementation:
44 virtual void Shutdown() OVERRIDE;
46 // ExtensionSystem implementation:
47 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE;
48 virtual ExtensionService* extension_service() OVERRIDE;
49 virtual RuntimeData* runtime_data() OVERRIDE;
50 virtual ManagementPolicy* management_policy() OVERRIDE;
51 virtual UserScriptMaster* user_script_master() OVERRIDE;
52 virtual ProcessManager* process_manager() OVERRIDE;
53 virtual StateStore* state_store() OVERRIDE;
54 virtual StateStore* rules_store() OVERRIDE;
55 virtual InfoMap* info_map() OVERRIDE;
56 virtual LazyBackgroundTaskQueue* lazy_background_task_queue()
58 virtual EventRouter* event_router() OVERRIDE;
59 virtual ExtensionWarningService* warning_service() OVERRIDE;
60 virtual Blacklist* blacklist() OVERRIDE;
61 virtual ErrorConsole* error_console() OVERRIDE;
62 virtual InstallVerifier* install_verifier() OVERRIDE;
63 virtual QuotaService* quota_service() OVERRIDE;
64 virtual void RegisterExtensionWithRequestContexts(
65 const Extension* extension) OVERRIDE;
66 virtual void UnregisterExtensionWithRequestContexts(
67 const std::string& extension_id,
68 const UnloadedExtensionInfo::Reason reason) OVERRIDE;
69 virtual const OneShotEvent& ready() const OVERRIDE;
72 content::BrowserContext* browser_context_; // Not owned.
74 // Data to be accessed on the IO thread. Must outlive process_manager_.
75 scoped_refptr<InfoMap> info_map_;
77 scoped_ptr<RuntimeData> runtime_data_;
78 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
79 scoped_ptr<EventRouter> event_router_;
80 scoped_ptr<ProcessManager> process_manager_;
81 scoped_ptr<QuotaService> quota_service_;
83 // Signaled when the extension system has completed its startup tasks.
86 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem);
89 } // namespace extensions
91 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_