Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / extensions / shell / browser / shell_extension_system.h
blobd4db30cba6c8ddd90fd7d0da6ebdd778f79c1c1b
1 // Copyright 2014 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 EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
6 #define EXTENSIONS_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 DeclarativeUserScriptManager;
27 class EventRouter;
28 class InfoMap;
29 class ProcessManager;
30 class RendererStartupHelper;
31 class SharedUserScriptMaster;
33 // A simplified version of ExtensionSystem for app_shell. Allows
34 // app_shell to skip initialization of services it doesn't need.
35 class ShellExtensionSystem : public ExtensionSystem {
36 public:
37 explicit ShellExtensionSystem(content::BrowserContext* browser_context);
38 ~ShellExtensionSystem() override;
40 // Loads an unpacked application from a directory. Returns the extension on
41 // success, or null otherwise.
42 const Extension* LoadApp(const base::FilePath& app_dir);
44 // Initializes the extension system.
45 void Init();
47 // Launch the app with id |extension_id|.
48 void LaunchApp(const std::string& extension_id);
50 // KeyedService implementation:
51 void Shutdown() override;
53 // ExtensionSystem implementation:
54 void InitForRegularProfile(bool extensions_enabled) override;
55 ExtensionService* extension_service() override;
56 RuntimeData* runtime_data() override;
57 ManagementPolicy* management_policy() override;
58 SharedUserScriptMaster* shared_user_script_master() override;
59 StateStore* state_store() override;
60 StateStore* rules_store() override;
61 InfoMap* info_map() override;
62 EventRouter* event_router() override;
63 QuotaService* quota_service() override;
64 void RegisterExtensionWithRequestContexts(
65 const Extension* extension) override;
66 void UnregisterExtensionWithRequestContexts(
67 const std::string& extension_id,
68 const UnloadedExtensionInfo::Reason reason) override;
69 const OneShotEvent& ready() const override;
70 ContentVerifier* content_verifier() override;
71 scoped_ptr<ExtensionSet> GetDependentExtensions(
72 const Extension* extension) override;
74 private:
75 content::BrowserContext* browser_context_; // Not owned.
77 // Data to be accessed on the IO thread. Must outlive process_manager_.
78 scoped_refptr<InfoMap> info_map_;
80 scoped_ptr<RuntimeData> runtime_data_;
81 scoped_ptr<EventRouter> event_router_;
82 scoped_ptr<QuotaService> quota_service_;
84 // Signaled when the extension system has completed its startup tasks.
85 OneShotEvent ready_;
87 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem);
90 } // namespace extensions
92 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_