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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_model.cc

Issue 2450633004: Make ToolbarActionsModel ignore calls to AddComponentAction() before initialization (Closed)
Patch Set: Move the initialization check to within AddComponentAction(); add a unit test Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/toolbar/toolbar_actions_model.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_model.cc b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
index 3d586be3b35bc29fd88fcaef625f1948720e7720..92b87d0f5dfd431a65f8ad292931d5e3f6c926c2 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_model.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
@@ -635,6 +635,9 @@ bool ToolbarActionsModel::HasComponentAction(
}
void ToolbarActionsModel::AddComponentAction(const std::string& action_id) {
+ if (!actions_initialized_)
imcheng 2016/10/26 01:32:03 Wait, so if we simply returned here, then wouldn't
Devlin 2016/10/26 16:41:56 We would have the same problem in Patch Set 1, if
takumif 2016/10/26 18:42:05 Right, the information does get lost. I think we d
takumif 2016/10/27 00:15:21 As I've discussed with Derek offline, there's an i
Devlin 2016/10/28 15:17:15 It seems to me part of the problem is that there a
takumif 2016/10/29 00:37:22 Yes, it does make sense. I think it'd still be nec
+ return;
+
DCHECK(use_redesign_);
ToolbarItem component_item(action_id, COMPONENT_ACTION);
DCHECK(!HasItem(component_item));

Powered by Google App Engine
This is Rietveld 408576698