| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 if (!controller->GetAnchorActionId().empty()) { | 313 if (!controller->GetAnchorActionId().empty()) { |
| 314 ToolbarActionView* action_view = | 314 ToolbarActionView* action_view = |
| 315 GetViewForId(controller->GetAnchorActionId()); | 315 GetViewForId(controller->GetAnchorActionId()); |
| 316 anchor_view = | 316 anchor_view = |
| 317 action_view->visible() ? action_view : GetOverflowReferenceView(); | 317 action_view->visible() ? action_view : GetOverflowReferenceView(); |
| 318 } else { | 318 } else { |
| 319 anchor_view = this; | 319 anchor_view = this; |
| 320 } | 320 } |
| 321 ToolbarActionsBarBubbleViews* bubble = | 321 ToolbarActionsBarBubbleViews* bubble = |
| 322 new ToolbarActionsBarBubbleViews(anchor_view, std::move(controller)); | 322 new ToolbarActionsBarBubbleViews(anchor_view, std::move(controller)); |
| 323 views::BubbleDelegateView::CreateBubble(bubble); | 323 views::BubbleDialogDelegateView::CreateBubble(bubble); |
| 324 bubble->Show(); | 324 bubble->Show(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 void BrowserActionsContainer::ShowExtensionMessageBubble( | 327 void BrowserActionsContainer::ShowExtensionMessageBubble( |
| 328 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller, | 328 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller, |
| 329 ToolbarActionViewController* anchor_action) { | 329 ToolbarActionViewController* anchor_action) { |
| 330 // The container shouldn't be asked to show a bubble if it's animating. | 330 // The container shouldn't be asked to show a bubble if it's animating. |
| 331 DCHECK(!animating()); | 331 DCHECK(!animating()); |
| 332 | 332 |
| 333 views::View* reference_view = | 333 views::View* reference_view = |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 warning_highlight_painter_.reset( | 760 warning_highlight_painter_.reset( |
| 761 views::Painter::CreateImageGridPainter(kWarningImages)); | 761 views::Painter::CreateImageGridPainter(kWarningImages)); |
| 762 } | 762 } |
| 763 | 763 |
| 764 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 764 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
| 765 DCHECK(active_bubble_); | 765 DCHECK(active_bubble_); |
| 766 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 766 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
| 767 widget->RemoveObserver(this); | 767 widget->RemoveObserver(this); |
| 768 active_bubble_ = nullptr; | 768 active_bubble_ = nullptr; |
| 769 } | 769 } |
| OLD | NEW |