Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: chrome/browser/extensions/extension_system_impl.h

Issue 197413002: Move extensions-related files to using //components/keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
7 7
8 #include "extensions/browser/extension_system.h" 8 #include "extensions/browser/extension_system.h"
9 #include "extensions/common/one_shot_event.h" 9 #include "extensions/common/one_shot_event.h"
10 10
11 class Profile; 11 class Profile;
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 class ExtensionSystemSharedFactory; 15 class ExtensionSystemSharedFactory;
16 class ExtensionWarningBadgeService; 16 class ExtensionWarningBadgeService;
17 class NavigationObserver; 17 class NavigationObserver;
18 class StandardManagementPolicyProvider; 18 class StandardManagementPolicyProvider;
19 19
20 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. 20 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl.
21 // Implementation details: non-shared services are owned by 21 // Implementation details: non-shared services are owned by
22 // ExtensionSystemImpl, a BrowserContextKeyedService with separate incognito 22 // ExtensionSystemImpl, a KeyedService with separate incognito
23 // instances. A private Shared class (also a BrowserContextKeyedService, 23 // instances. A private Shared class (also a KeyedService,
24 // but with a shared instance for incognito) keeps the common services. 24 // but with a shared instance for incognito) keeps the common services.
25 class ExtensionSystemImpl : public ExtensionSystem { 25 class ExtensionSystemImpl : public ExtensionSystem {
26 public: 26 public:
27 explicit ExtensionSystemImpl(Profile* profile); 27 explicit ExtensionSystemImpl(Profile* profile);
28 virtual ~ExtensionSystemImpl(); 28 virtual ~ExtensionSystemImpl();
29 29
30 // BrowserContextKeyedService implementation. 30 // KeyedService implementation.
31 virtual void Shutdown() OVERRIDE; 31 virtual void Shutdown() OVERRIDE;
32 32
33 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; 33 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE;
34 34
35 virtual ExtensionService* extension_service() OVERRIDE; // shared 35 virtual ExtensionService* extension_service() OVERRIDE; // shared
36 virtual RuntimeData* runtime_data() OVERRIDE; // shared 36 virtual RuntimeData* runtime_data() OVERRIDE; // shared
37 virtual ManagementPolicy* management_policy() OVERRIDE; // shared 37 virtual ManagementPolicy* management_policy() OVERRIDE; // shared
38 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared 38 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared
39 virtual ProcessManager* process_manager() OVERRIDE; 39 virtual ProcessManager* process_manager() OVERRIDE;
40 virtual StateStore* state_store() OVERRIDE; // shared 40 virtual StateStore* state_store() OVERRIDE; // shared
(...skipping 15 matching lines...) Expand all
56 const std::string& extension_id, 56 const std::string& extension_id,
57 const UnloadedExtensionInfo::Reason reason) OVERRIDE; 57 const UnloadedExtensionInfo::Reason reason) OVERRIDE;
58 58
59 virtual const OneShotEvent& ready() const OVERRIDE; 59 virtual const OneShotEvent& ready() const OVERRIDE;
60 60
61 private: 61 private:
62 friend class ExtensionSystemSharedFactory; 62 friend class ExtensionSystemSharedFactory;
63 63
64 // Owns the Extension-related systems that have a single instance 64 // Owns the Extension-related systems that have a single instance
65 // shared between normal and incognito profiles. 65 // shared between normal and incognito profiles.
66 class Shared : public BrowserContextKeyedService { 66 class Shared : public KeyedService {
67 public: 67 public:
68 explicit Shared(Profile* profile); 68 explicit Shared(Profile* profile);
69 virtual ~Shared(); 69 virtual ~Shared();
70 70
71 // Initialization takes place in phases. 71 // Initialization takes place in phases.
72 virtual void InitPrefs(); 72 virtual void InitPrefs();
73 // This must not be called until all the providers have been created. 73 // This must not be called until all the providers have been created.
74 void RegisterManagementPolicyProviders(); 74 void RegisterManagementPolicyProviders();
75 void Init(bool extensions_enabled); 75 void Init(bool extensions_enabled);
76 76
77 // BrowserContextKeyedService implementation. 77 // KeyedService implementation.
78 virtual void Shutdown() OVERRIDE; 78 virtual void Shutdown() OVERRIDE;
79 79
80 StateStore* state_store(); 80 StateStore* state_store();
81 StateStore* rules_store(); 81 StateStore* rules_store();
82 ExtensionService* extension_service(); 82 ExtensionService* extension_service();
83 RuntimeData* runtime_data(); 83 RuntimeData* runtime_data();
84 ManagementPolicy* management_policy(); 84 ManagementPolicy* management_policy();
85 UserScriptMaster* user_script_master(); 85 UserScriptMaster* user_script_master();
86 Blacklist* blacklist(); 86 Blacklist* blacklist();
87 InfoMap* info_map(); 87 InfoMap* info_map();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // extension processes and those require access to the ResourceContext owned 139 // extension processes and those require access to the ResourceContext owned
140 // by |io_data_|. 140 // by |io_data_|.
141 scoped_ptr<ProcessManager> process_manager_; 141 scoped_ptr<ProcessManager> process_manager_;
142 142
143 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); 143 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl);
144 }; 144 };
145 145
146 } // namespace extensions 146 } // namespace extensions
147 147
148 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 148 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_system_factory.cc ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698