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

Unified Diff: chrome/browser/ui/views/toolbar/browser_actions_container.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/views/toolbar/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
index 405285ee224afd2072960d5098d5ebf603424a6e..1f041081d600914acc792891c26ead896ce45a62 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -79,6 +79,7 @@ BrowserActionsContainer::BrowserActionsContainer(
resize_area_(NULL),
chevron_(NULL),
suppress_chevron_(false),
+ added_to_view_(false),
resize_amount_(0),
animation_target_size_(0) {
set_id(VIEW_ID_BROWSER_ACTION_TOOLBAR);
@@ -251,6 +252,12 @@ void BrowserActionsContainer::RemoveAllViews() {
}
void BrowserActionsContainer::Redraw(bool order_changed) {
+ if (!added_to_view_) {
+ // We don't want to redraw before the view has been fully added to the
+ // hierarchy.
+ return;
+ }
+
std::vector<ToolbarActionViewController*> actions =
toolbar_actions_bar_->toolbar_actions();
if (order_changed) {
@@ -733,6 +740,8 @@ void BrowserActionsContainer::ViewHierarchyChanged(
// calls Layout on the Toolbar, which needs this object to be constructed
// before its Layout function is called.
toolbar_actions_bar_->CreateActions();
+
+ added_to_view_ = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698