| OLD | NEW | 
|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" | 
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 63 #include "chrome/browser/ui/views/avatar_menu_button.h" | 63 #include "chrome/browser/ui/views/avatar_menu_button.h" | 
| 64 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 64 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 
| 65 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 65 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 
| 66 #include "chrome/browser/ui/views/browser_dialogs.h" | 66 #include "chrome/browser/ui/views/browser_dialogs.h" | 
| 67 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 67 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 
| 68 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 68 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 
| 69 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 69 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 
| 70 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" | 70 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" | 
| 71 #include "chrome/browser/ui/views/frame/contents_container.h" | 71 #include "chrome/browser/ui/views/frame/contents_container.h" | 
| 72 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 72 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 
|  | 73 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" | 
| 73 #include "chrome/browser/ui/views/frame/top_container_view.h" | 74 #include "chrome/browser/ui/views/frame/top_container_view.h" | 
| 74 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 75 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 
| 75 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 76 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 
| 76 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 77 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 
| 77 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 78 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 
| 78 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 79 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 
| 79 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" | 80 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" | 
| 80 #include "chrome/browser/ui/views/password_generation_bubble_view.h" | 81 #include "chrome/browser/ui/views/password_generation_bubble_view.h" | 
| 81 #include "chrome/browser/ui/views/profile_chooser_view.h" | 82 #include "chrome/browser/ui/views/profile_chooser_view.h" | 
| 82 #include "chrome/browser/ui/views/status_bubble_views.h" | 83 #include "chrome/browser/ui/views/status_bubble_views.h" | 
| (...skipping 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2533   // Create the view and the frame. The frame will attach itself via the view | 2534   // Create the view and the frame. The frame will attach itself via the view | 
| 2534   // so we don't need to do anything with the pointer. | 2535   // so we don't need to do anything with the pointer. | 
| 2535   BrowserView* view = new BrowserView(); | 2536   BrowserView* view = new BrowserView(); | 
| 2536   view->Init(browser); | 2537   view->Init(browser); | 
| 2537   (new BrowserFrame(view))->InitBrowserFrame(); | 2538   (new BrowserFrame(view))->InitBrowserFrame(); | 
| 2538   view->GetWidget()->non_client_view()->SetAccessibleName( | 2539   view->GetWidget()->non_client_view()->SetAccessibleName( | 
| 2539       l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2540       l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 
| 2540   return view; | 2541   return view; | 
| 2541 } | 2542 } | 
| 2542 | 2543 | 
|  | 2544 // static | 
|  | 2545 chrome::HostDesktopType BrowserWindow::AdjustHostDesktopType( | 
|  | 2546     chrome::HostDesktopType desktop_type) { | 
|  | 2547   return NativeBrowserFrameFactory::AdjustHostDesktopType(desktop_type); | 
|  | 2548 } | 
|  | 2549 | 
| 2543 void BrowserView::ShowAvatarBubble(WebContents* web_contents, | 2550 void BrowserView::ShowAvatarBubble(WebContents* web_contents, | 
| 2544                                    const gfx::Rect& rect) { | 2551                                    const gfx::Rect& rect) { | 
| 2545   gfx::Point origin(rect.origin()); | 2552   gfx::Point origin(rect.origin()); | 
| 2546   views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2553   views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 
| 2547   gfx::Rect bounds(origin, rect.size()); | 2554   gfx::Rect bounds(origin, rect.size()); | 
| 2548 | 2555 | 
| 2549   AvatarMenuBubbleView::ShowBubble(this, views::BubbleBorder::TOP_RIGHT, | 2556   AvatarMenuBubbleView::ShowBubble(this, views::BubbleBorder::TOP_RIGHT, | 
| 2550       views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get()); | 2557       views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get()); | 
| 2551 } | 2558 } | 
| 2552 | 2559 | 
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2695       !GetLocationBar()->GetLocationEntry()->model()->popup_model()->IsOpen()) { | 2702       !GetLocationBar()->GetLocationEntry()->model()->popup_model()->IsOpen()) { | 
| 2696     gfx::Point icon_bottom( | 2703     gfx::Point icon_bottom( | 
| 2697         toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2704         toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 
| 2698     ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2705     ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 
| 2699     gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2706     gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 
| 2700     ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2707     ConvertPointToTarget(infobar_container_, this, &infobar_top); | 
| 2701     top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2708     top_arrow_height = infobar_top.y() - icon_bottom.y(); | 
| 2702   } | 2709   } | 
| 2703   return top_arrow_height; | 2710   return top_arrow_height; | 
| 2704 } | 2711 } | 
| OLD | NEW | 
|---|