| 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 18 matching lines...) Expand all Loading... |
| 29 class ProcessManager; | 29 class ProcessManager; |
| 30 class RendererStartupHelper; | 30 class RendererStartupHelper; |
| 31 | 31 |
| 32 // A simplified version of ExtensionSystem for app_shell. Allows | 32 // A simplified version of ExtensionSystem for app_shell. Allows |
| 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 // Runs LoadApp() and LaunchApp(). |
| 40 // Returns true on success. | |
| 41 bool LoadAndLaunchApp(const base::FilePath& app_dir); | 40 bool LoadAndLaunchApp(const base::FilePath& app_dir); |
| 42 | 41 |
| 42 // Loads an unpacked application from a directory. Returns true on success. |
| 43 bool LoadApp(const base::FilePath& app_dir); |
| 44 |
| 45 // Launch the currently loaded app. |
| 46 void LaunchApp(); |
| 47 |
| 43 // KeyedService implementation: | 48 // KeyedService implementation: |
| 44 virtual void Shutdown() OVERRIDE; | 49 virtual void Shutdown() OVERRIDE; |
| 45 | 50 |
| 46 // ExtensionSystem implementation: | 51 // ExtensionSystem implementation: |
| 47 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; | 52 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; |
| 48 virtual ExtensionService* extension_service() OVERRIDE; | 53 virtual ExtensionService* extension_service() OVERRIDE; |
| 49 virtual RuntimeData* runtime_data() OVERRIDE; | 54 virtual RuntimeData* runtime_data() OVERRIDE; |
| 50 virtual ManagementPolicy* management_policy() OVERRIDE; | 55 virtual ManagementPolicy* management_policy() OVERRIDE; |
| 51 virtual UserScriptMaster* user_script_master() OVERRIDE; | 56 virtual UserScriptMaster* user_script_master() OVERRIDE; |
| 52 virtual ProcessManager* process_manager() OVERRIDE; | 57 virtual ProcessManager* process_manager() OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 const UnloadedExtensionInfo::Reason reason) OVERRIDE; | 73 const UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| 69 virtual const OneShotEvent& ready() const OVERRIDE; | 74 virtual const OneShotEvent& ready() const OVERRIDE; |
| 70 virtual ContentVerifier* content_verifier() OVERRIDE; | 75 virtual ContentVerifier* content_verifier() OVERRIDE; |
| 71 | 76 |
| 72 private: | 77 private: |
| 73 content::BrowserContext* browser_context_; // Not owned. | 78 content::BrowserContext* browser_context_; // Not owned. |
| 74 | 79 |
| 75 // Extension ID for the app. | 80 // Extension ID for the app. |
| 76 std::string app_id_; | 81 std::string app_id_; |
| 77 | 82 |
| 83 scoped_refptr<Extension> extension_; |
| 84 |
| 78 // Data to be accessed on the IO thread. Must outlive process_manager_. | 85 // Data to be accessed on the IO thread. Must outlive process_manager_. |
| 79 scoped_refptr<InfoMap> info_map_; | 86 scoped_refptr<InfoMap> info_map_; |
| 80 | 87 |
| 81 scoped_ptr<RuntimeData> runtime_data_; | 88 scoped_ptr<RuntimeData> runtime_data_; |
| 82 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 89 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
| 83 scoped_ptr<EventRouter> event_router_; | 90 scoped_ptr<EventRouter> event_router_; |
| 84 scoped_ptr<ProcessManager> process_manager_; | 91 scoped_ptr<ProcessManager> process_manager_; |
| 85 scoped_ptr<QuotaService> quota_service_; | 92 scoped_ptr<QuotaService> quota_service_; |
| 86 | 93 |
| 87 // Signaled when the extension system has completed its startup tasks. | 94 // Signaled when the extension system has completed its startup tasks. |
| 88 OneShotEvent ready_; | 95 OneShotEvent ready_; |
| 89 | 96 |
| 90 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); | 97 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); |
| 91 }; | 98 }; |
| 92 | 99 |
| 93 } // namespace extensions | 100 } // namespace extensions |
| 94 | 101 |
| 95 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ | 102 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ |
| OLD | NEW |