| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 extensions::ExtensionMessageBubbleView* bubble = | 332 extensions::ExtensionMessageBubbleView* bubble = |
| 333 new extensions::ExtensionMessageBubbleView( | 333 new extensions::ExtensionMessageBubbleView( |
| 334 anchor_view, views::BubbleBorder::TOP_RIGHT, std::move(controller)); | 334 anchor_view, views::BubbleBorder::TOP_RIGHT, std::move(controller)); |
| 335 views::BubbleDelegateView::CreateBubble(bubble); | 335 views::BubbleDelegateView::CreateBubble(bubble); |
| 336 active_bubble_ = bubble; | 336 active_bubble_ = bubble; |
| 337 active_bubble_->GetWidget()->AddObserver(this); | 337 active_bubble_->GetWidget()->AddObserver(this); |
| 338 bubble->Show(); | 338 bubble->Show(); |
| 339 } else { | 339 } else { |
| 340 ToolbarActionsBarBubbleViews* bubble = | 340 ToolbarActionsBarBubbleViews* bubble = |
| 341 new ToolbarActionsBarBubbleViews(anchor_view, std::move(controller)); | 341 new ToolbarActionsBarBubbleViews(anchor_view, std::move(controller)); |
| 342 views::BubbleDelegateView::CreateBubble(bubble); | 342 views::BubbleDialogDelegateView::CreateBubble(bubble); |
| 343 active_bubble_ = bubble; | 343 active_bubble_ = bubble; |
| 344 active_bubble_->GetWidget()->AddObserver(this); | 344 active_bubble_->GetWidget()->AddObserver(this); |
| 345 bubble->Show(); | 345 bubble->Show(); |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 | 348 |
| 349 void BrowserActionsContainer::OnWidgetClosing(views::Widget* widget) { | 349 void BrowserActionsContainer::OnWidgetClosing(views::Widget* widget) { |
| 350 ClearActiveBubble(widget); | 350 ClearActiveBubble(widget); |
| 351 } | 351 } |
| 352 | 352 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 views::Painter::CreateImageGridPainter(kWarningImages)); | 760 views::Painter::CreateImageGridPainter(kWarningImages)); |
| 761 } | 761 } |
| 762 | 762 |
| 763 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 763 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
| 764 DCHECK(active_bubble_); | 764 DCHECK(active_bubble_); |
| 765 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 765 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
| 766 widget->RemoveObserver(this); | 766 widget->RemoveObserver(this); |
| 767 active_bubble_ = nullptr; | 767 active_bubble_ = nullptr; |
| 768 toolbar_actions_bar_->OnBubbleClosed(); | 768 toolbar_actions_bar_->OnBubbleClosed(); |
| 769 } | 769 } |
| OLD | NEW |