Added unit test for DevTools' ephemeral port support.
[chromium-blink-merge.git] / apps / shell / browser / shell_extension_system.h
blob2c1f81838a9372f94fab6d2db4845ec63dd4c168
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
3 // found in the LICENSE file.
5 #ifndef APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
6 #define APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
8 #include <vector>
10 #include "base/compiler_specific.h"
11 #include "extensions/browser/extension_system.h"
12 #include "extensions/common/one_shot_event.h"
14 class BrowserContextKeyedServiceFactory;
16 namespace base {
17 class FilePath;
20 namespace content {
21 class BrowserContext;
24 namespace extensions {
26 class EventRouter;
27 class InfoMap;
28 class LazyBackgroundTaskQueue;
29 class ProcessManager;
30 class RendererStartupHelper;
32 // A simplified version of ExtensionSystem for app_shell. Allows
33 // app_shell to skip initialization of services it doesn't need.
34 class ShellExtensionSystem : public ExtensionSystem {
35 public:
36 explicit ShellExtensionSystem(content::BrowserContext* browser_context);
37 virtual ~ShellExtensionSystem();
39 // Loads an unpacked application from a directory. Returns true on success.
40 bool LoadApp(const base::FilePath& app_dir);
42 // Launch the currently loaded app.
43 void LaunchApp();
45 // KeyedService implementation:
46 virtual void Shutdown() OVERRIDE;
48 // ExtensionSystem implementation:
49 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE;
50 virtual ExtensionService* extension_service() OVERRIDE;
51 virtual RuntimeData* runtime_data() OVERRIDE;
52 virtual ManagementPolicy* management_policy() OVERRIDE;
53 virtual UserScriptMaster* user_script_master() OVERRIDE;
54 virtual ProcessManager* process_manager() OVERRIDE;
55 virtual StateStore* state_store() OVERRIDE;
56 virtual StateStore* rules_store() OVERRIDE;
57 virtual InfoMap* info_map() OVERRIDE;
58 virtual LazyBackgroundTaskQueue* lazy_background_task_queue()
59 OVERRIDE;
60 virtual EventRouter* event_router() OVERRIDE;
61 virtual ExtensionWarningService* warning_service() OVERRIDE;
62 virtual Blacklist* blacklist() OVERRIDE;
63 virtual ErrorConsole* error_console() OVERRIDE;
64 virtual InstallVerifier* install_verifier() OVERRIDE;
65 virtual QuotaService* quota_service() OVERRIDE;
66 virtual void RegisterExtensionWithRequestContexts(
67 const Extension* extension) OVERRIDE;
68 virtual void UnregisterExtensionWithRequestContexts(
69 const std::string& extension_id,
70 const UnloadedExtensionInfo::Reason reason) OVERRIDE;
71 virtual const OneShotEvent& ready() const OVERRIDE;
72 virtual ContentVerifier* content_verifier() OVERRIDE;
74 private:
75 content::BrowserContext* browser_context_; // Not owned.
77 // Extension ID for the app.
78 std::string app_id_;
80 scoped_refptr<Extension> extension_;
82 // Data to be accessed on the IO thread. Must outlive process_manager_.
83 scoped_refptr<InfoMap> info_map_;
85 scoped_ptr<RuntimeData> runtime_data_;
86 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
87 scoped_ptr<EventRouter> event_router_;
88 scoped_ptr<ProcessManager> process_manager_;
89 scoped_ptr<QuotaService> quota_service_;
91 // Signaled when the extension system has completed its startup tasks.
92 OneShotEvent ready_;
94 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem);
97 } // namespace extensions
99 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_