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

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

Issue 2450633004: Make ToolbarActionsModel ignore calls to AddComponentAction() before initialization (Closed)
Patch Set: Created 4 years, 1 month 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 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Object that knows how to manage component actions in the toolbar model. 70 // Object that knows how to manage component actions in the toolbar model.
71 class ComponentActionDelegate { 71 class ComponentActionDelegate {
72 public: 72 public:
73 // Adds or removes the component action labeled by |action_id| from the 73 // Adds or removes the component action labeled by |action_id| from the
74 // toolbar model. The caller will not add the same action twice. 74 // toolbar model. The caller will not add the same action twice.
75 virtual void AddComponentAction(const std::string& action_id) = 0; 75 virtual void AddComponentAction(const std::string& action_id) = 0;
76 virtual void RemoveComponentAction(const std::string& action_id) = 0; 76 virtual void RemoveComponentAction(const std::string& action_id) = 0;
77 77
78 // Returns |true| if the toolbar model has an action for |action_id|. 78 // Returns |true| if the toolbar model has an action for |action_id|.
79 virtual bool HasComponentAction(const std::string& action_id) const = 0; 79 virtual bool HasComponentAction(const std::string& action_id) const = 0;
80
81 // Returns |true| if the toolbar actions have been initialized.
82 virtual bool ActionsInitialized() const = 0;
80 }; 83 };
81 84
82 ComponentMigrationHelper(Profile* profile, ComponentActionDelegate* delegate); 85 ComponentMigrationHelper(Profile* profile, ComponentActionDelegate* delegate);
83 ~ComponentMigrationHelper() override; 86 ~ComponentMigrationHelper() override;
84 87
85 static void RegisterPrefs(PrefRegistrySimple* registry); 88 static void RegisterPrefs(PrefRegistrySimple* registry);
86 89
87 // Registers and unregisters a component action/extension pair. A component 90 // Registers and unregisters a component action/extension pair. A component
88 // action may have more than one associated extension id, but not vice versa. 91 // action may have more than one associated extension id, but not vice versa.
89 void Register(const std::string& component_action_id, 92 void Register(const std::string& component_action_id,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 142
140 // A list of pairs of component action ids and extension ids. 143 // A list of pairs of component action ids and extension ids.
141 std::vector<std::pair<std::string, ExtensionId>> migrated_actions_; 144 std::vector<std::pair<std::string, ExtensionId>> migrated_actions_;
142 145
143 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelper); 146 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelper);
144 }; 147 };
145 148
146 } // namespace extensions 149 } // namespace extensions
147 150
148 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_ 151 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_MIGRATION_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698