Chromium Code Reviews| 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 |