| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 void BrowserActionsContainer::Init() { | 136 void BrowserActionsContainer::Init() { |
| 137 LoadImages(); | 137 LoadImages(); |
| 138 | 138 |
| 139 // We wait to set the container width until now so that the chevron images | 139 // We wait to set the container width until now so that the chevron images |
| 140 // will be loaded. The width calculation needs to know the chevron size. | 140 // will be loaded. The width calculation needs to know the chevron size. |
| 141 container_width_ = toolbar_actions_bar_->GetPreferredSize().width(); | 141 container_width_ = toolbar_actions_bar_->GetPreferredSize().width(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 const std::string& BrowserActionsContainer::GetIdAt(size_t index) const { | 144 std::string BrowserActionsContainer::GetIdAt(size_t index) const { |
| 145 return toolbar_action_views_[index]->view_controller()->GetId(); | 145 return toolbar_action_views_[index]->view_controller()->GetId(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 ToolbarActionView* BrowserActionsContainer::GetViewForId( | 148 ToolbarActionView* BrowserActionsContainer::GetViewForId( |
| 149 const std::string& id) { | 149 const std::string& id) { |
| 150 for (ToolbarActionView* view : toolbar_action_views_) { | 150 for (ToolbarActionView* view : toolbar_action_views_) { |
| 151 if (view->view_controller()->GetId() == id) | 151 if (view->view_controller()->GetId() == id) |
| 152 return view; | 152 return view; |
| 153 } | 153 } |
| 154 return nullptr; | 154 return nullptr; |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 warning_highlight_painter_.reset( | 796 warning_highlight_painter_.reset( |
| 797 views::Painter::CreateImageGridPainter(kWarningImages)); | 797 views::Painter::CreateImageGridPainter(kWarningImages)); |
| 798 } | 798 } |
| 799 | 799 |
| 800 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 800 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
| 801 DCHECK(active_bubble_); | 801 DCHECK(active_bubble_); |
| 802 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 802 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
| 803 widget->RemoveObserver(this); | 803 widget->RemoveObserver(this); |
| 804 active_bubble_ = nullptr; | 804 active_bubble_ = nullptr; |
| 805 } | 805 } |
| OLD | NEW |