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 28 matching lines...) Expand all Loading... |
39 #include "chrome/browser/tabs/tab_strip_model.h" | 39 #include "chrome/browser/tabs/tab_strip_model.h" |
40 #include "chrome/browser/themes/theme_service.h" | 40 #include "chrome/browser/themes/theme_service.h" |
41 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 41 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
43 #include "chrome/browser/ui/browser_dialogs.h" | 43 #include "chrome/browser/ui/browser_dialogs.h" |
44 #include "chrome/browser/ui/browser_list.h" | 44 #include "chrome/browser/ui/browser_list.h" |
45 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 45 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
46 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 46 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
47 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 47 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
48 #include "chrome/browser/ui/view_ids.h" | 48 #include "chrome/browser/ui/view_ids.h" |
| 49 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
49 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 50 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
50 #include "chrome/browser/ui/views/browser_dialogs.h" | 51 #include "chrome/browser/ui/views/browser_dialogs.h" |
51 #include "chrome/browser/ui/views/default_search_view.h" | 52 #include "chrome/browser/ui/views/default_search_view.h" |
52 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 53 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
53 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 54 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
54 #include "chrome/browser/ui/views/frame/contents_container.h" | 55 #include "chrome/browser/ui/views/frame/contents_container.h" |
55 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 56 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
56 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 57 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
57 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 58 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
58 #include "chrome/browser/ui/views/page_info_window.h" | 59 #include "chrome/browser/ui/views/page_info_window.h" |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2559 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2559 // Create the view and the frame. The frame will attach itself via the view | 2560 // Create the view and the frame. The frame will attach itself via the view |
2560 // so we don't need to do anything with the pointer. | 2561 // so we don't need to do anything with the pointer. |
2561 BrowserView* view = new BrowserView(browser); | 2562 BrowserView* view = new BrowserView(browser); |
2562 (new BrowserFrame(view))->InitBrowserFrame(); | 2563 (new BrowserFrame(view))->InitBrowserFrame(); |
2563 view->GetWidget()->non_client_view()->SetAccessibleName( | 2564 view->GetWidget()->non_client_view()->SetAccessibleName( |
2564 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2565 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
2565 return view; | 2566 return view; |
2566 } | 2567 } |
2567 #endif | 2568 #endif |
| 2569 |
| 2570 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, |
| 2571 const gfx::Rect& rect) { |
| 2572 gfx::Point origin(rect.right(), rect.bottom()); |
| 2573 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2574 gfx::Rect bounds; |
| 2575 bounds.set_origin(origin); |
| 2576 |
| 2577 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); |
| 2578 // Bubble::Show() takes ownership of the view. |
| 2579 Bubble::Show(this->GetWidget(), bounds, |
| 2580 views::BubbleBorder::TOP_RIGHT, |
| 2581 bubble_view, bubble_view); |
| 2582 } |
OLD | NEW |