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

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

Issue 754473003: [Extensions Toolbar Mac] More cleanup of BrowserActionsController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
index 5f57805d67e1f3fed3da413887135e4996a49d56..d6956d3c5206d8743886573c76edd384f85b423f 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
@@ -79,7 +79,7 @@ ToolbarActionsBar::ToolbarActionsBar(ToolbarActionsBarDelegate* delegate,
platform_settings_(in_overflow_mode),
model_observer_(this),
suppress_layout_(false),
- suppress_animation_(!model_ || !model_->extensions_initialized()) {
+ suppress_animation_(true) {
if (model_) // |model_| can be null in unittests.
model_observer_.Add(model_);
}
@@ -241,6 +241,14 @@ void ToolbarActionsBar::CreateActions() {
for (size_t i = 0; i < toolbar_actions_.size(); ++i)
delegate_->AddViewForAction(toolbar_actions_[i], i);
}
+
+ if (!toolbar_actions_.empty()) {
+ delegate_->Redraw(false);
+ ResizeDelegate(gfx::Tween::EASE_OUT, false);
+ }
+
+ // Once the actions are created, we should animate the changes.
+ suppress_animation_ = false;
}
void ToolbarActionsBar::DeleteActions() {
@@ -434,12 +442,7 @@ void ToolbarActionsBar::ToolbarHighlightModeChanged(bool is_highlighting) {
void ToolbarActionsBar::OnToolbarModelInitialized() {
// We shouldn't have any actions before the model is initialized.
DCHECK(toolbar_actions_.empty());
- suppress_animation_ = false;
CreateActions();
- if (!toolbar_actions_.empty()) {
- delegate_->Redraw(false);
- ResizeDelegate(gfx::Tween::EASE_OUT, false);
- }
}
void ToolbarActionsBar::OnToolbarReorderNecessary(

Powered by Google App Engine
This is Rietveld 408576698