Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 1877143002: Convert ToolbarActionsBarBubbleViews to BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 anchor_view = BrowserView::GetBrowserViewForBrowser(browser_) 321 anchor_view = BrowserView::GetBrowserViewForBrowser(browser_)
322 ->toolbar() 322 ->toolbar()
323 ->app_menu_button(); 323 ->app_menu_button();
324 } 324 }
325 } else { 325 } else {
326 anchor_view = this; 326 anchor_view = this;
327 } 327 }
328 328
329 ToolbarActionsBarBubbleViews* bubble = 329 ToolbarActionsBarBubbleViews* bubble =
330 new ToolbarActionsBarBubbleViews(anchor_view, std::move(controller)); 330 new ToolbarActionsBarBubbleViews(anchor_view, std::move(controller));
331 views::BubbleDelegateView::CreateBubble(bubble);
332 active_bubble_ = bubble; 331 active_bubble_ = bubble;
333 active_bubble_->GetWidget()->AddObserver(this); 332 views::BubbleDialogDelegateView::CreateBubble(bubble);
333 bubble->GetWidget()->AddObserver(this);
334 bubble->Show(); 334 bubble->Show();
335 } 335 }
336 336
337 void BrowserActionsContainer::OnWidgetClosing(views::Widget* widget) { 337 void BrowserActionsContainer::OnWidgetClosing(views::Widget* widget) {
338 ClearActiveBubble(widget); 338 ClearActiveBubble(widget);
339 } 339 }
340 340
341 void BrowserActionsContainer::OnWidgetDestroying(views::Widget* widget) { 341 void BrowserActionsContainer::OnWidgetDestroying(views::Widget* widget) {
342 ClearActiveBubble(widget); 342 ClearActiveBubble(widget);
343 } 343 }
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 views::Painter::CreateImageGridPainter(kWarningImages)); 748 views::Painter::CreateImageGridPainter(kWarningImages));
749 } 749 }
750 750
751 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { 751 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) {
752 DCHECK(active_bubble_); 752 DCHECK(active_bubble_);
753 DCHECK_EQ(active_bubble_->GetWidget(), widget); 753 DCHECK_EQ(active_bubble_->GetWidget(), widget);
754 widget->RemoveObserver(this); 754 widget->RemoveObserver(this);
755 active_bubble_ = nullptr; 755 active_bubble_ = nullptr;
756 toolbar_actions_bar_->OnBubbleClosed(); 756 toolbar_actions_bar_->OnBubbleClosed();
757 } 757 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698