| OLD | NEW |
| 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 Loading... |
| 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 // TODO(msw): Set and support views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE. | 2618 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); |
| 2619 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, | 2619 // Bubble::Show() takes ownership of the view. |
| 2620 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); | 2620 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, |
| 2621 views::BubbleDelegateView::CreateBubble(bubble); | 2621 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, |
| 2622 bubble->Show(); | 2622 bubble_view, bubble_view); |
| 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 } |
| OLD | NEW |