OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ |
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 class LazyBackgroundTaskQueue; | 29 class LazyBackgroundTaskQueue; |
30 class ProcessManager; | 30 class ProcessManager; |
31 class RendererStartupHelper; | 31 class RendererStartupHelper; |
32 class SharedUserScriptMaster; | 32 class SharedUserScriptMaster; |
33 | 33 |
34 // A simplified version of ExtensionSystem for app_shell. Allows | 34 // A simplified version of ExtensionSystem for app_shell. Allows |
35 // app_shell to skip initialization of services it doesn't need. | 35 // app_shell to skip initialization of services it doesn't need. |
36 class ShellExtensionSystem : public ExtensionSystem { | 36 class ShellExtensionSystem : public ExtensionSystem { |
37 public: | 37 public: |
38 explicit ShellExtensionSystem(content::BrowserContext* browser_context); | 38 explicit ShellExtensionSystem(content::BrowserContext* browser_context); |
39 virtual ~ShellExtensionSystem(); | 39 ~ShellExtensionSystem() override; |
40 | 40 |
41 // Loads an unpacked application from a directory. Returns true on success. | 41 // Loads an unpacked application from a directory. Returns true on success. |
42 bool LoadApp(const base::FilePath& app_dir); | 42 bool LoadApp(const base::FilePath& app_dir); |
43 | 43 |
44 // Launch the currently loaded app. | 44 // Launch the currently loaded app. |
45 void LaunchApp(); | 45 void LaunchApp(); |
46 | 46 |
47 // KeyedService implementation: | 47 // KeyedService implementation: |
48 virtual void Shutdown() override; | 48 void Shutdown() override; |
49 | 49 |
50 scoped_refptr<Extension> extension() { return extension_; } | 50 scoped_refptr<Extension> extension() { return extension_; } |
51 | 51 |
52 // ExtensionSystem implementation: | 52 // ExtensionSystem implementation: |
53 virtual void InitForRegularProfile(bool extensions_enabled) override; | 53 void InitForRegularProfile(bool extensions_enabled) override; |
54 virtual ExtensionService* extension_service() override; | 54 ExtensionService* extension_service() override; |
55 virtual RuntimeData* runtime_data() override; | 55 RuntimeData* runtime_data() override; |
56 virtual ManagementPolicy* management_policy() override; | 56 ManagementPolicy* management_policy() override; |
57 virtual SharedUserScriptMaster* shared_user_script_master() override; | 57 SharedUserScriptMaster* shared_user_script_master() override; |
58 virtual ProcessManager* process_manager() override; | 58 ProcessManager* process_manager() override; |
59 virtual StateStore* state_store() override; | 59 StateStore* state_store() override; |
60 virtual StateStore* rules_store() override; | 60 StateStore* rules_store() override; |
61 virtual InfoMap* info_map() override; | 61 InfoMap* info_map() override; |
62 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() override; | 62 LazyBackgroundTaskQueue* lazy_background_task_queue() override; |
63 virtual EventRouter* event_router() override; | 63 EventRouter* event_router() override; |
64 virtual WarningService* warning_service() override; | 64 WarningService* warning_service() override; |
65 virtual Blacklist* blacklist() override; | 65 Blacklist* blacklist() override; |
66 virtual ErrorConsole* error_console() override; | 66 ErrorConsole* error_console() override; |
67 virtual InstallVerifier* install_verifier() override; | 67 InstallVerifier* install_verifier() override; |
68 virtual QuotaService* quota_service() override; | 68 QuotaService* quota_service() override; |
69 virtual void RegisterExtensionWithRequestContexts( | 69 void RegisterExtensionWithRequestContexts( |
70 const Extension* extension) override; | 70 const Extension* extension) override; |
71 virtual void UnregisterExtensionWithRequestContexts( | 71 void UnregisterExtensionWithRequestContexts( |
72 const std::string& extension_id, | 72 const std::string& extension_id, |
73 const UnloadedExtensionInfo::Reason reason) override; | 73 const UnloadedExtensionInfo::Reason reason) override; |
74 virtual const OneShotEvent& ready() const override; | 74 const OneShotEvent& ready() const override; |
75 virtual ContentVerifier* content_verifier() override; | 75 ContentVerifier* content_verifier() override; |
76 virtual scoped_ptr<ExtensionSet> GetDependentExtensions( | 76 scoped_ptr<ExtensionSet> GetDependentExtensions( |
77 const Extension* extension) override; | 77 const Extension* extension) override; |
78 virtual DeclarativeUserScriptMaster* | 78 DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension( |
79 GetDeclarativeUserScriptMasterByExtension( | 79 const ExtensionId& extension_id) override; |
80 const ExtensionId& extension_id) override; | |
81 | 80 |
82 private: | 81 private: |
83 content::BrowserContext* browser_context_; // Not owned. | 82 content::BrowserContext* browser_context_; // Not owned. |
84 | 83 |
85 // Extension ID for the app. | 84 // Extension ID for the app. |
86 std::string app_id_; | 85 std::string app_id_; |
87 | 86 |
88 scoped_refptr<Extension> extension_; | 87 scoped_refptr<Extension> extension_; |
89 | 88 |
90 // Data to be accessed on the IO thread. Must outlive process_manager_. | 89 // Data to be accessed on the IO thread. Must outlive process_manager_. |
91 scoped_refptr<InfoMap> info_map_; | 90 scoped_refptr<InfoMap> info_map_; |
92 | 91 |
93 scoped_ptr<RuntimeData> runtime_data_; | 92 scoped_ptr<RuntimeData> runtime_data_; |
94 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 93 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
95 scoped_ptr<EventRouter> event_router_; | 94 scoped_ptr<EventRouter> event_router_; |
96 scoped_ptr<ProcessManager> process_manager_; | 95 scoped_ptr<ProcessManager> process_manager_; |
97 scoped_ptr<QuotaService> quota_service_; | 96 scoped_ptr<QuotaService> quota_service_; |
98 | 97 |
99 // Signaled when the extension system has completed its startup tasks. | 98 // Signaled when the extension system has completed its startup tasks. |
100 OneShotEvent ready_; | 99 OneShotEvent ready_; |
101 | 100 |
102 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); | 101 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); |
103 }; | 102 }; |
104 | 103 |
105 } // namespace extensions | 104 } // namespace extensions |
106 | 105 |
107 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 106 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ |
OLD | NEW |