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 // Returns the list of services on which |this| depends.
40 static std::vector
<BrowserContextKeyedServiceFactory
*> GetDependencies();
42 // Loads an unpacked application from a directory and attempts to launch it.
43 // Returns true on success.
44 bool LoadAndLaunchApp(const base::FilePath
& app_dir
);
46 // BrowserContextKeyedService implementation:
47 virtual void Shutdown() OVERRIDE
;
49 // ExtensionSystem implementation:
50 virtual void InitForRegularProfile(bool extensions_enabled
) OVERRIDE
;
51 virtual ExtensionService
* extension_service() OVERRIDE
;
52 virtual RuntimeData
* runtime_data() OVERRIDE
;
53 virtual ManagementPolicy
* management_policy() OVERRIDE
;
54 virtual UserScriptMaster
* user_script_master() OVERRIDE
;
55 virtual ProcessManager
* process_manager() OVERRIDE
;
56 virtual StateStore
* state_store() OVERRIDE
;
57 virtual StateStore
* rules_store() OVERRIDE
;
58 virtual InfoMap
* info_map() OVERRIDE
;
59 virtual LazyBackgroundTaskQueue
* lazy_background_task_queue()
61 virtual EventRouter
* event_router() OVERRIDE
;
62 virtual ExtensionWarningService
* warning_service() OVERRIDE
;
63 virtual Blacklist
* blacklist() OVERRIDE
;
64 virtual ErrorConsole
* error_console() OVERRIDE
;
65 virtual InstallVerifier
* install_verifier() OVERRIDE
;
66 virtual QuotaService
* quota_service() OVERRIDE
;
67 virtual void RegisterExtensionWithRequestContexts(
68 const Extension
* extension
) OVERRIDE
;
69 virtual void UnregisterExtensionWithRequestContexts(
70 const std::string
& extension_id
,
71 const UnloadedExtensionInfo::Reason reason
) OVERRIDE
;
72 virtual const OneShotEvent
& ready() const OVERRIDE
;
75 content::BrowserContext
* browser_context_
; // Not owned.
77 // Data to be accessed on the IO thread. Must outlive process_manager_.
78 scoped_refptr
<InfoMap
> info_map_
;
80 scoped_ptr
<RuntimeData
> runtime_data_
;
81 scoped_ptr
<LazyBackgroundTaskQueue
> lazy_background_task_queue_
;
82 scoped_ptr
<EventRouter
> event_router_
;
83 scoped_ptr
<ProcessManager
> process_manager_
;
84 scoped_ptr
<QuotaService
> quota_service_
;
86 // Signaled when the extension system has completed its startup tasks.
89 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem
);
92 } // namespace extensions
94 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_