| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 shown_bubble_ = true; | 217 shown_bubble_ = true; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void BrowserActionsContainer::AddViewForAction( | 220 void BrowserActionsContainer::AddViewForAction( |
| 221 ToolbarActionViewController* view_controller, | 221 ToolbarActionViewController* view_controller, |
| 222 size_t index) { | 222 size_t index) { |
| 223 if (chevron_) | 223 if (chevron_) |
| 224 chevron_->CloseMenu(); | 224 chevron_->CloseMenu(); |
| 225 | 225 |
| 226 ToolbarActionView* view = | 226 ToolbarActionView* view = new ToolbarActionView(view_controller, this); |
| 227 new ToolbarActionView(view_controller, browser_->profile(), this); | |
| 228 toolbar_action_views_.insert(toolbar_action_views_.begin() + index, view); | 227 toolbar_action_views_.insert(toolbar_action_views_.begin() + index, view); |
| 229 AddChildViewAt(view, index); | 228 AddChildViewAt(view, index); |
| 230 } | 229 } |
| 231 | 230 |
| 232 void BrowserActionsContainer::RemoveViewForAction( | 231 void BrowserActionsContainer::RemoveViewForAction( |
| 233 ToolbarActionViewController* action) { | 232 ToolbarActionViewController* action) { |
| 234 if (chevron_) | 233 if (chevron_) |
| 235 chevron_->CloseMenu(); | 234 chevron_->CloseMenu(); |
| 236 | 235 |
| 237 for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin(); | 236 for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin(); |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 warning_highlight_painter_.reset( | 788 warning_highlight_painter_.reset( |
| 790 views::Painter::CreateImageGridPainter(kWarningImages)); | 789 views::Painter::CreateImageGridPainter(kWarningImages)); |
| 791 } | 790 } |
| 792 | 791 |
| 793 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 792 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
| 794 DCHECK(active_bubble_); | 793 DCHECK(active_bubble_); |
| 795 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 794 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
| 796 widget->RemoveObserver(this); | 795 widget->RemoveObserver(this); |
| 797 active_bubble_ = nullptr; | 796 active_bubble_ = nullptr; |
| 798 } | 797 } |
| OLD | NEW |