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