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