OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMPONENT_MIGRATION_HELPER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 std::set<std::string> enabled_actions_; | 117 std::set<std::string> enabled_actions_; |
118 | 118 |
119 private: | 119 private: |
120 bool IsExtensionInstalledAndEnabled(const ExtensionId& extension_id) const; | 120 bool IsExtensionInstalledAndEnabled(const ExtensionId& extension_id) const; |
121 void UnloadExtension(const ExtensionId& extension_id); | 121 void UnloadExtension(const ExtensionId& extension_id); |
122 void RemoveComponentActionPref(const std::string& component_action_id); | 122 void RemoveComponentActionPref(const std::string& component_action_id); |
123 std::vector<std::string> GetExtensionIdsForActionId( | 123 std::vector<std::string> GetExtensionIdsForActionId( |
124 const std::string& component_action_id) const; | 124 const std::string& component_action_id) const; |
125 std::string GetActionIdForExtensionId(const ExtensionId& extension_id) const; | 125 std::string GetActionIdForExtensionId(const ExtensionId& extension_id) const; |
126 | 126 |
127 Profile* const profile_; | |
128 ComponentActionDelegate* const delegate_; | 127 ComponentActionDelegate* const delegate_; |
129 // The ExtensionRegistry, PrefService, and ExtensionSystem, cached for | 128 // The ExtensionRegistry, PrefService, and ExtensionSystem, cached for |
130 // convenience. | 129 // convenience. |
131 ExtensionRegistry* const extension_registry_; | 130 ExtensionRegistry* const extension_registry_; |
132 PrefService* const pref_service_; | 131 PrefService* const pref_service_; |
133 ExtensionSystem* const extension_system_; | 132 ExtensionSystem* const extension_system_; |
134 | 133 |
135 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 134 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
136 extension_registry_observer_; | 135 extension_registry_observer_; |
137 | 136 |
138 // A list of pairs of component action ids and extension ids. | 137 // A list of pairs of component action ids and extension ids. |
139 std::vector<std::pair<std::string, ExtensionId>> migrated_actions_; | 138 std::vector<std::pair<std::string, ExtensionId>> migrated_actions_; |
140 | 139 |
141 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelper); | 140 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelper); |
142 }; | 141 }; |
143 | 142 |
144 } // namespace extensions | 143 } // namespace extensions |
145 | 144 |
146 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ | 145 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ |
OLD | NEW |