| 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 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2597 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2598 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2598 // Create the view and the frame. The frame will attach itself via the view | 2599 // Create the view and the frame. The frame will attach itself via the view |
| 2599 // so we don't need to do anything with the pointer. | 2600 // so we don't need to do anything with the pointer. |
| 2600 BrowserView* view = new BrowserView(browser); | 2601 BrowserView* view = new BrowserView(browser); |
| 2601 (new BrowserFrame(view))->InitBrowserFrame(); | 2602 (new BrowserFrame(view))->InitBrowserFrame(); |
| 2602 view->GetWidget()->non_client_view()->SetAccessibleName( | 2603 view->GetWidget()->non_client_view()->SetAccessibleName( |
| 2603 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2604 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 2604 return view; | 2605 return view; |
| 2605 } | 2606 } |
| 2606 #endif | 2607 #endif |
| 2608 |
| 2609 void BrowserView::ShowAvatarBubble(TabContents* tab_contents, int x, int y) { |
| 2610 gfx::Point origin(x, y); |
| 2611 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2612 gfx::Rect bounds; |
| 2613 bounds.set_origin(origin); |
| 2614 |
| 2615 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); |
| 2616 // Bubble::Show() takes ownership of the view. |
| 2617 Bubble::Show(this->GetWidget(), bounds, |
| 2618 views::BubbleBorder::TOP_RIGHT, |
| 2619 bubble_view, bubble_view); |
| 2620 } |
| OLD | NEW |