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

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

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix extensions_unittests Created 5 years, 4 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
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 "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "extensions/browser/extension_system.h" 9 #include "extensions/browser/extension_system.h"
10 #include "extensions/common/one_shot_event.h" 10 #include "extensions/common/one_shot_event.h"
11 11
12 class DeclarativeUserScriptManager; 12 class DeclarativeUserScriptManager;
13 class Profile; 13 class Profile;
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 class ContentVerifier; 17 class ContentVerifier;
18 class ExtensionSystemSharedFactory; 18 class ExtensionSystemSharedFactory;
19 class NavigationObserver; 19 class NavigationObserver;
20 class SharedUserScriptMaster; 20 class SharedUserScriptMaster;
21 class StateStoreNotificationObserver; 21 class StateStoreNotificationObserver;
not at google - send to devlin 2015/08/03 21:12:08 Unrelated cleanup: of these, ContentVerifier and S
Marc Treib 2015/08/04 08:36:28 Done.
22 22
23 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. 23 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl.
24 // Implementation details: non-shared services are owned by 24 // Implementation details: non-shared services are owned by
25 // ExtensionSystemImpl, a KeyedService with separate incognito 25 // ExtensionSystemImpl, a KeyedService with separate incognito
26 // instances. A private Shared class (also a KeyedService, 26 // instances. A private Shared class (also a KeyedService,
27 // but with a shared instance for incognito) keeps the common services. 27 // but with a shared instance for incognito) keeps the common services.
28 class ExtensionSystemImpl : public ExtensionSystem { 28 class ExtensionSystemImpl : public ExtensionSystem {
29 public: 29 public:
30 explicit ExtensionSystemImpl(Profile* profile); 30 explicit ExtensionSystemImpl(Profile* profile);
31 ~ExtensionSystemImpl() override; 31 ~ExtensionSystemImpl() override;
32 32
33 // KeyedService implementation. 33 // KeyedService implementation.
34 void Shutdown() override; 34 void Shutdown() override;
35 35
36 void InitForRegularProfile(bool extensions_enabled) override; 36 void InitForRegularProfile(bool extensions_enabled) override;
37 37
38 ExtensionService* extension_service() override; // shared 38 ExtensionService* extension_service() override; // shared
39 RuntimeData* runtime_data() override; // shared 39 RuntimeData* runtime_data() override; // shared
40 ManagementPolicy* management_policy() override; // shared 40 ManagementPolicy* management_policy() override; // shared
41 SharedUserScriptMaster* shared_user_script_master() override; // shared 41 SharedUserScriptMaster* shared_user_script_master() override; // shared
42 StateStore* state_store() override; // shared 42 StateStore* state_store() override; // shared
43 StateStore* rules_store() override; // shared 43 StateStore* rules_store() override; // shared
44 InfoMap* info_map() override; // shared 44 InfoMap* info_map() override; // shared
45 QuotaService* quota_service() override; // shared 45 QuotaService* quota_service() override; // shared
46 AppSorting* app_sorting() override; // shared
46 47
47 void RegisterExtensionWithRequestContexts( 48 void RegisterExtensionWithRequestContexts(
48 const Extension* extension, 49 const Extension* extension,
49 const base::Closure& callback) override; 50 const base::Closure& callback) override;
50 51
51 void UnregisterExtensionWithRequestContexts( 52 void UnregisterExtensionWithRequestContexts(
52 const std::string& extension_id, 53 const std::string& extension_id,
53 const UnloadedExtensionInfo::Reason reason) override; 54 const UnloadedExtensionInfo::Reason reason) override;
54 55
55 const OneShotEvent& ready() const override; 56 const OneShotEvent& ready() const override;
(...skipping 21 matching lines...) Expand all
77 void Shutdown() override; 78 void Shutdown() override;
78 79
79 StateStore* state_store(); 80 StateStore* state_store();
80 StateStore* rules_store(); 81 StateStore* rules_store();
81 ExtensionService* extension_service(); 82 ExtensionService* extension_service();
82 RuntimeData* runtime_data(); 83 RuntimeData* runtime_data();
83 ManagementPolicy* management_policy(); 84 ManagementPolicy* management_policy();
84 SharedUserScriptMaster* shared_user_script_master(); 85 SharedUserScriptMaster* shared_user_script_master();
85 InfoMap* info_map(); 86 InfoMap* info_map();
86 QuotaService* quota_service(); 87 QuotaService* quota_service();
88 AppSorting* app_sorting();
87 const OneShotEvent& ready() const { return ready_; } 89 const OneShotEvent& ready() const { return ready_; }
88 ContentVerifier* content_verifier(); 90 ContentVerifier* content_verifier();
89 91
90 private: 92 private:
91 Profile* profile_; 93 Profile* profile_;
92 94
93 // The services that are shared between normal and incognito profiles. 95 // The services that are shared between normal and incognito profiles.
94 96
95 scoped_ptr<StateStore> state_store_; 97 scoped_ptr<StateStore> state_store_;
96 scoped_ptr<StateStoreNotificationObserver> 98 scoped_ptr<StateStoreNotificationObserver>
97 state_store_notification_observer_; 99 state_store_notification_observer_;
98 scoped_ptr<StateStore> rules_store_; 100 scoped_ptr<StateStore> rules_store_;
99 scoped_ptr<NavigationObserver> navigation_observer_; 101 scoped_ptr<NavigationObserver> navigation_observer_;
100 // Shared memory region manager for scripts statically declared in extension 102 // Shared memory region manager for scripts statically declared in extension
101 // manifests. This region is shared between all extensions. 103 // manifests. This region is shared between all extensions.
102 scoped_ptr<SharedUserScriptMaster> shared_user_script_master_; 104 scoped_ptr<SharedUserScriptMaster> shared_user_script_master_;
103 scoped_ptr<RuntimeData> runtime_data_; 105 scoped_ptr<RuntimeData> runtime_data_;
104 // ExtensionService depends on StateStore, Blacklist and RuntimeData. 106 // ExtensionService depends on StateStore, Blacklist and RuntimeData.
105 scoped_ptr<ExtensionService> extension_service_; 107 scoped_ptr<ExtensionService> extension_service_;
106 scoped_ptr<ManagementPolicy> management_policy_; 108 scoped_ptr<ManagementPolicy> management_policy_;
107 // extension_info_map_ needs to outlive process_manager_. 109 // extension_info_map_ needs to outlive process_manager_.
108 scoped_refptr<InfoMap> extension_info_map_; 110 scoped_refptr<InfoMap> extension_info_map_;
109 scoped_ptr<QuotaService> quota_service_; 111 scoped_ptr<QuotaService> quota_service_;
112 scoped_ptr<AppSorting> app_sorting_;
110 113
111 // For verifying the contents of extensions read from disk. 114 // For verifying the contents of extensions read from disk.
112 scoped_refptr<ContentVerifier> content_verifier_; 115 scoped_refptr<ContentVerifier> content_verifier_;
113 116
114 #if defined(OS_CHROMEOS) 117 #if defined(OS_CHROMEOS)
115 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> 118 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider>
116 device_local_account_management_policy_provider_; 119 device_local_account_management_policy_provider_;
117 #endif 120 #endif
118 121
119 OneShotEvent ready_; 122 OneShotEvent ready_;
120 }; 123 };
121 124
122 Profile* profile_; 125 Profile* profile_;
123 126
124 Shared* shared_; 127 Shared* shared_;
125 128
126 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); 129 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl);
127 }; 130 };
128 131
129 } // namespace extensions 132 } // namespace extensions
130 133
131 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 134 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698