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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // Call when we should potentially add the component action and unload | 94 // Call when we should potentially add the component action and unload |
95 // the extension. PREREQUISITE: The extension action redesign MUST be | 95 // the extension. PREREQUISITE: The extension action redesign MUST be |
96 // enabled. | 96 // enabled. |
97 void OnFeatureEnabled(const std::string& component_action_id); | 97 void OnFeatureEnabled(const std::string& component_action_id); |
98 | 98 |
99 // Call when we should potentially remove the component action and re-enable | 99 // Call when we should potentially remove the component action and re-enable |
100 // extension loading. | 100 // extension loading. |
101 void OnFeatureDisabled(const std::string& component_action_id); | 101 void OnFeatureDisabled(const std::string& component_action_id); |
102 | 102 |
| 103 // Call when the user manually removes the component action from the toolbar. |
| 104 void OnActionRemoved(const std::string& component_action_id); |
| 105 |
103 // extensions::ExtensionRegistryObserver: | 106 // extensions::ExtensionRegistryObserver: |
104 void OnExtensionReady(content::BrowserContext* browser_context, | 107 void OnExtensionReady(content::BrowserContext* browser_context, |
105 const Extension* extension) override; | 108 const Extension* extension) override; |
106 | 109 |
107 protected: | 110 protected: |
108 // Protected for unit testing. | 111 // Protected for unit testing. |
109 void SetComponentActionPref(const std::string& component_action_id, | 112 void SetComponentActionPref(const std::string& component_action_id, |
110 bool enabled); | 113 bool enabled); |
111 | 114 |
112 // A set of component action ids whose features are currently enabled. | 115 // A set of component action ids whose features are currently enabled. |
(...skipping 21 matching lines...) Expand all Loading... |
134 | 137 |
135 // A list of pairs of component action ids and extension ids. | 138 // A list of pairs of component action ids and extension ids. |
136 std::vector<std::pair<std::string, ExtensionId>> migrated_actions_; | 139 std::vector<std::pair<std::string, ExtensionId>> migrated_actions_; |
137 | 140 |
138 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelper); | 141 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelper); |
139 }; | 142 }; |
140 | 143 |
141 } // namespace extensions | 144 } // namespace extensions |
142 | 145 |
143 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ |
OLD | NEW |