OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 5 #ifndef APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ |
6 #define APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 6 #define APPS_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 22 matching lines...) Expand all Loading... |
33 // app_shell to skip initialization of services it doesn't need. | 33 // app_shell to skip initialization of services it doesn't need. |
34 class ShellExtensionSystem : public ExtensionSystem { | 34 class ShellExtensionSystem : public ExtensionSystem { |
35 public: | 35 public: |
36 explicit ShellExtensionSystem(content::BrowserContext* browser_context); | 36 explicit ShellExtensionSystem(content::BrowserContext* browser_context); |
37 virtual ~ShellExtensionSystem(); | 37 virtual ~ShellExtensionSystem(); |
38 | 38 |
39 // Loads an unpacked application from a directory and attempts to launch it. | 39 // Loads an unpacked application from a directory and attempts to launch it. |
40 // Returns true on success. | 40 // Returns true on success. |
41 bool LoadAndLaunchApp(const base::FilePath& app_dir); | 41 bool LoadAndLaunchApp(const base::FilePath& app_dir); |
42 | 42 |
| 43 // Closes the running app. |
| 44 void CloseApp(); |
| 45 |
43 // BrowserContextKeyedService implementation: | 46 // BrowserContextKeyedService implementation: |
44 virtual void Shutdown() OVERRIDE; | 47 virtual void Shutdown() OVERRIDE; |
45 | 48 |
46 // ExtensionSystem implementation: | 49 // ExtensionSystem implementation: |
47 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; | 50 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; |
48 virtual ExtensionService* extension_service() OVERRIDE; | 51 virtual ExtensionService* extension_service() OVERRIDE; |
49 virtual RuntimeData* runtime_data() OVERRIDE; | 52 virtual RuntimeData* runtime_data() OVERRIDE; |
50 virtual ManagementPolicy* management_policy() OVERRIDE; | 53 virtual ManagementPolicy* management_policy() OVERRIDE; |
51 virtual UserScriptMaster* user_script_master() OVERRIDE; | 54 virtual UserScriptMaster* user_script_master() OVERRIDE; |
52 virtual ProcessManager* process_manager() OVERRIDE; | 55 virtual ProcessManager* process_manager() OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
64 virtual void RegisterExtensionWithRequestContexts( | 67 virtual void RegisterExtensionWithRequestContexts( |
65 const Extension* extension) OVERRIDE; | 68 const Extension* extension) OVERRIDE; |
66 virtual void UnregisterExtensionWithRequestContexts( | 69 virtual void UnregisterExtensionWithRequestContexts( |
67 const std::string& extension_id, | 70 const std::string& extension_id, |
68 const UnloadedExtensionInfo::Reason reason) OVERRIDE; | 71 const UnloadedExtensionInfo::Reason reason) OVERRIDE; |
69 virtual const OneShotEvent& ready() const OVERRIDE; | 72 virtual const OneShotEvent& ready() const OVERRIDE; |
70 | 73 |
71 private: | 74 private: |
72 content::BrowserContext* browser_context_; // Not owned. | 75 content::BrowserContext* browser_context_; // Not owned. |
73 | 76 |
| 77 // Extension ID for the app. |
| 78 std::string app_id_; |
| 79 |
74 // Data to be accessed on the IO thread. Must outlive process_manager_. | 80 // Data to be accessed on the IO thread. Must outlive process_manager_. |
75 scoped_refptr<InfoMap> info_map_; | 81 scoped_refptr<InfoMap> info_map_; |
76 | 82 |
77 scoped_ptr<RuntimeData> runtime_data_; | 83 scoped_ptr<RuntimeData> runtime_data_; |
78 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 84 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
79 scoped_ptr<EventRouter> event_router_; | 85 scoped_ptr<EventRouter> event_router_; |
80 scoped_ptr<ProcessManager> process_manager_; | 86 scoped_ptr<ProcessManager> process_manager_; |
81 scoped_ptr<QuotaService> quota_service_; | 87 scoped_ptr<QuotaService> quota_service_; |
82 | 88 |
83 // Signaled when the extension system has completed its startup tasks. | 89 // Signaled when the extension system has completed its startup tasks. |
84 OneShotEvent ready_; | 90 OneShotEvent ready_; |
85 | 91 |
86 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); | 92 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); |
87 }; | 93 }; |
88 | 94 |
89 } // namespace extensions | 95 } // namespace extensions |
90 | 96 |
91 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 97 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ |
OLD | NEW |