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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 8500004: Rebase AvatarMenuBubbleView on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 return view; 2608 return view;
2609 } 2609 }
2610 #endif 2610 #endif
2611 2611
2612 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, 2612 void BrowserView::ShowAvatarBubble(TabContents* tab_contents,
2613 const gfx::Rect& rect) { 2613 const gfx::Rect& rect) {
2614 gfx::Point origin(rect.origin()); 2614 gfx::Point origin(rect.origin());
2615 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); 2615 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin);
2616 gfx::Rect bounds(origin, rect.size()); 2616 gfx::Rect bounds(origin, rect.size());
2617 2617
2618 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); 2618 // TODO(msw): Set and support views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE.
2619 // Bubble::Show() takes ownership of the view. 2619 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this,
2620 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, 2620 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get());
2621 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, 2621 views::BubbleDelegateView::CreateBubble(bubble);
2622 bubble_view, bubble_view); 2622 bubble->Show();
2623 } 2623 }
2624 2624
2625 void BrowserView::ShowAvatarBubbleFromAvatarButton() { 2625 void BrowserView::ShowAvatarBubbleFromAvatarButton() {
2626 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); 2626 AvatarMenuButton* button = frame_->GetAvatarMenuButton();
2627 if (button) 2627 if (button)
2628 button->ShowAvatarBubble(); 2628 button->ShowAvatarBubble();
2629 } 2629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698