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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 toolbar_action_views_.insert(toolbar_action_views_.begin() + index, | 164 toolbar_action_views_.insert(toolbar_action_views_.begin() + index, |
165 base::WrapUnique(view)); | 165 base::WrapUnique(view)); |
166 AddChildViewAt(view, index); | 166 AddChildViewAt(view, index); |
167 } | 167 } |
168 | 168 |
169 void BrowserActionsContainer::RemoveViewForAction( | 169 void BrowserActionsContainer::RemoveViewForAction( |
170 ToolbarActionViewController* action) { | 170 ToolbarActionViewController* action) { |
171 for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin(); | 171 for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin(); |
172 iter != toolbar_action_views_.end(); ++iter) { | 172 iter != toolbar_action_views_.end(); ++iter) { |
173 if ((*iter)->view_controller() == action) { | 173 if ((*iter)->view_controller() == action) { |
| 174 action->HidePopup(); |
174 toolbar_action_views_.erase(iter); | 175 toolbar_action_views_.erase(iter); |
175 break; | 176 break; |
176 } | 177 } |
177 } | 178 } |
178 } | 179 } |
179 | 180 |
180 void BrowserActionsContainer::RemoveAllViews() { | 181 void BrowserActionsContainer::RemoveAllViews() { |
181 toolbar_action_views_.clear(); | 182 toolbar_action_views_.clear(); |
182 } | 183 } |
183 | 184 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 659 } |
659 } | 660 } |
660 | 661 |
661 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 662 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
662 DCHECK(active_bubble_); | 663 DCHECK(active_bubble_); |
663 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 664 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
664 widget->RemoveObserver(this); | 665 widget->RemoveObserver(this); |
665 active_bubble_ = nullptr; | 666 active_bubble_ = nullptr; |
666 toolbar_actions_bar_->OnBubbleClosed(); | 667 toolbar_actions_bar_->OnBubbleClosed(); |
667 } | 668 } |
OLD | NEW |