| 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 2585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2596 BrowserView* view = new BrowserView(browser); | 2596 BrowserView* view = new BrowserView(browser); |
| 2597 (new BrowserFrame(view))->InitBrowserFrame(); | 2597 (new BrowserFrame(view))->InitBrowserFrame(); |
| 2598 view->GetWidget()->non_client_view()->SetAccessibleName( | 2598 view->GetWidget()->non_client_view()->SetAccessibleName( |
| 2599 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2599 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 2600 return view; | 2600 return view; |
| 2601 } | 2601 } |
| 2602 #endif | 2602 #endif |
| 2603 | 2603 |
| 2604 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, | 2604 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, |
| 2605 const gfx::Rect& rect) { | 2605 const gfx::Rect& rect) { |
| 2606 gfx::Point origin(rect.right(), rect.bottom()); | 2606 gfx::Point origin(rect.origin()); |
| 2607 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2607 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2608 gfx::Rect bounds; | 2608 gfx::Rect bounds(origin, rect.size()); |
| 2609 bounds.set_origin(origin); | |
| 2610 | 2609 |
| 2611 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); | 2610 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); |
| 2612 // Bubble::Show() takes ownership of the view. | 2611 // Bubble::Show() takes ownership of the view. |
| 2613 Bubble::Show(this->GetWidget(), bounds, | 2612 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, |
| 2614 views::BubbleBorder::TOP_RIGHT, | 2613 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, |
| 2615 bubble_view, bubble_view); | 2614 bubble_view, bubble_view); |
| 2616 } | 2615 } |
| 2617 | 2616 |
| 2618 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2617 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2619 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2618 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2620 if (button) | 2619 if (button) |
| 2621 button->ShowAvatarBubble(); | 2620 button->ShowAvatarBubble(); |
| 2622 } | 2621 } |
| OLD | NEW |