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

Unified Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 726813002: [Extensions Toolbar] Make the ExtensionToolbarModel icon count more stable (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 e967347a1aae23f54b0eaace2d7c566cd827c95c..1fb378bfc9e2e3e700cee222d3b29bd335e95bf9 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -126,8 +126,6 @@ void BrowserActionsContainer::Init() {
// We wait to set the container width until now so that the chevron images
// will be loaded. The width calculation needs to know the chevron size.
container_width_ = toolbar_actions_bar_->GetPreferredSize().width();
-
- initialized_ = true;
}
const std::string& BrowserActionsContainer::GetIdAt(size_t index) {
@@ -221,6 +219,10 @@ ToolbarActionView* BrowserActionsContainer::GetMainViewForAction(
return main_container_->toolbar_action_views_[index];
}
+bool BrowserActionsContainer::IsReady() const {
+ return initialized_;
Peter Kasting 2014/11/14 21:31:58 So what happens if we allow additions at any time?
Devlin 2014/11/14 22:00:38 Hmm. I think I misread the comment on line 734, a
+}
+
void BrowserActionsContainer::AddViewForAction(
ToolbarActionViewController* view_controller,
size_t index) {
@@ -727,6 +729,8 @@ void BrowserActionsContainer::ViewHierarchyChanged(
this));
}
+ initialized_ = true;
Peter Kasting 2014/11/14 21:31:58 This seems suspicious. Why do we have to set this
Devlin 2014/11/14 22:00:37 We still need Init(), but we actually don't need i
+
// Initial toolbar button creation and placement in the widget hierarchy.
// We do this here instead of in the constructor because adding views
// calls Layout on the Toolbar, which needs this object to be constructed

Powered by Google App Engine
This is Rietveld 408576698