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 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 // Create the view and the frame. The frame will attach itself via the view | 2659 // Create the view and the frame. The frame will attach itself via the view |
2660 // so we don't need to do anything with the pointer. | 2660 // so we don't need to do anything with the pointer. |
2661 BrowserView* view = new BrowserView(browser); | 2661 BrowserView* view = new BrowserView(browser); |
2662 (new BrowserFrame(view))->InitBrowserFrame(); | 2662 (new BrowserFrame(view))->InitBrowserFrame(); |
2663 view->GetWidget()->non_client_view()->SetAccessibleName( | 2663 view->GetWidget()->non_client_view()->SetAccessibleName( |
2664 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2664 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
2665 return view; | 2665 return view; |
2666 } | 2666 } |
2667 #endif | 2667 #endif |
2668 | 2668 |
2669 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, | 2669 void BrowserView::ShowAvatarBubble(WebContents* web_contents, |
2670 const gfx::Rect& rect) { | 2670 const gfx::Rect& rect) { |
2671 gfx::Point origin(rect.origin()); | 2671 gfx::Point origin(rect.origin()); |
2672 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2672 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
2673 gfx::Rect bounds(origin, rect.size()); | 2673 gfx::Rect bounds(origin, rect.size()); |
2674 | 2674 |
2675 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, | 2675 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, |
2676 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); | 2676 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); |
2677 browser::CreateViewsBubble(bubble); | 2677 browser::CreateViewsBubble(bubble); |
2678 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2678 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2679 bubble->Show(); | 2679 bubble->Show(); |
2680 } | 2680 } |
2681 | 2681 |
2682 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2682 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2683 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2683 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2684 if (button) | 2684 if (button) |
2685 button->ShowAvatarBubble(); | 2685 button->ShowAvatarBubble(); |
2686 } | 2686 } |
OLD | NEW |