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 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2626 return view; | 2626 return view; |
2627 } | 2627 } |
2628 #endif | 2628 #endif |
2629 | 2629 |
2630 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, | 2630 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, |
2631 const gfx::Rect& rect) { | 2631 const gfx::Rect& rect) { |
2632 gfx::Point origin(rect.origin()); | 2632 gfx::Point origin(rect.origin()); |
2633 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2633 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
2634 gfx::Rect bounds(origin, rect.size()); | 2634 gfx::Rect bounds(origin, rect.size()); |
2635 | 2635 |
2636 // TODO(msw): Set and support views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE. | |
2637 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, | 2636 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, |
2638 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); | 2637 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); |
2639 browser::CreateViewsBubble(bubble); | 2638 browser::CreateViewsBubble(bubble); |
| 2639 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2640 bubble->Show(); | 2640 bubble->Show(); |
2641 } | 2641 } |
2642 | 2642 |
2643 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2643 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2644 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2644 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2645 if (button) | 2645 if (button) |
2646 button->ShowAvatarBubble(); | 2646 button->ShowAvatarBubble(); |
2647 } | 2647 } |
OLD | NEW |