Chromium Code Reviews| 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. | 2636 // TODO(msw): Set and support views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE. |
|
msw
2011/12/08 00:40:14
PLease remove TODO if this CL gets the job done; t
sail
2011/12/08 01:41:10
Done.
| |
| 2637 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, | 2637 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, |
| 2638 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); | 2638 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); |
| 2639 views::BubbleDelegateView::CreateBubble(bubble); | 2639 views::BubbleDelegateView::CreateBubble(bubble); |
| 2640 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | |
| 2640 bubble->Show(); | 2641 bubble->Show(); |
| 2641 } | 2642 } |
| 2642 | 2643 |
| 2643 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2644 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2644 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2645 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2645 if (button) | 2646 if (button) |
| 2646 button->ShowAvatarBubble(); | 2647 button->ShowAvatarBubble(); |
| 2647 } | 2648 } |
| OLD | NEW |