1 // Copyright 2014 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 EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
6 #define EXTENSIONS_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 RendererStartupHelper
;
29 class SharedUserScriptMaster
;
31 // A simplified version of ExtensionSystem for app_shell. Allows
32 // app_shell to skip initialization of services it doesn't need.
33 class ShellExtensionSystem
: public ExtensionSystem
{
35 explicit ShellExtensionSystem(content::BrowserContext
* browser_context
);
36 ~ShellExtensionSystem() override
;
38 // Loads an unpacked application from a directory. Returns the extension on
39 // success, or null otherwise.
40 const Extension
* LoadApp(const base::FilePath
& app_dir
);
42 // Initializes the extension system.
45 // Launch the app with id |extension_id|.
46 void LaunchApp(const std::string
& extension_id
);
48 // KeyedService implementation:
49 void Shutdown() override
;
51 // ExtensionSystem implementation:
52 void InitForRegularProfile(bool extensions_enabled
) override
;
53 ExtensionService
* extension_service() override
;
54 RuntimeData
* runtime_data() override
;
55 ManagementPolicy
* management_policy() override
;
56 SharedUserScriptMaster
* shared_user_script_master() override
;
57 StateStore
* state_store() override
;
58 StateStore
* rules_store() override
;
59 InfoMap
* info_map() override
;
60 QuotaService
* quota_service() override
;
61 void RegisterExtensionWithRequestContexts(
62 const Extension
* extension
) override
;
63 void UnregisterExtensionWithRequestContexts(
64 const std::string
& extension_id
,
65 const UnloadedExtensionInfo::Reason reason
) override
;
66 const OneShotEvent
& ready() const override
;
67 ContentVerifier
* content_verifier() override
;
68 scoped_ptr
<ExtensionSet
> GetDependentExtensions(
69 const Extension
* extension
) 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
<QuotaService
> quota_service_
;
80 // Signaled when the extension system has completed its startup tasks.
83 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem
);
86 } // namespace extensions
88 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_