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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 67 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
68 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" | 68 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" |
69 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" | 69 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" |
70 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 70 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
71 #include "chrome/browser/ui/views/frame/top_container_view.h" | 71 #include "chrome/browser/ui/views/frame/top_container_view.h" |
72 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 72 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
73 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 73 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
74 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 74 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
75 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 75 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
76 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 76 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 77 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
77 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 78 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
78 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" | 79 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" |
79 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 80 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
80 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 81 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
81 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" | 82 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" |
82 #include "chrome/browser/ui/views/status_bubble_views.h" | 83 #include "chrome/browser/ui/views/status_bubble_views.h" |
83 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 84 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
84 #include "chrome/browser/ui/views/tabs/tab.h" | 85 #include "chrome/browser/ui/views/tabs/tab.h" |
85 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 86 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
86 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 87 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 | 818 |
818 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() && | 819 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() && |
819 GetWidget()->IsVisible()) { | 820 GetWidget()->IsVisible()) { |
820 // We only restore focus if our window is visible, to avoid invoking blur | 821 // We only restore focus if our window is visible, to avoid invoking blur |
821 // handlers when we are eventually shown. | 822 // handlers when we are eventually shown. |
822 new_contents->RestoreFocus(); | 823 new_contents->RestoreFocus(); |
823 } | 824 } |
824 | 825 |
825 // Update all the UI bits. | 826 // Update all the UI bits. |
826 UpdateTitleBar(); | 827 UpdateTitleBar(); |
| 828 |
| 829 TranslateBubbleView::CloseBubble(); |
| 830 ZoomBubbleView::CloseBubble(); |
827 } | 831 } |
828 | 832 |
829 void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) { | 833 void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) { |
830 GetLocationBarView()->ZoomChangedForActiveTab( | 834 GetLocationBarView()->ZoomChangedForActiveTab( |
831 can_show_bubble && !toolbar_->IsWrenchMenuShowing()); | 835 can_show_bubble && !toolbar_->IsWrenchMenuShowing()); |
832 } | 836 } |
833 | 837 |
834 gfx::Rect BrowserView::GetRestoredBounds() const { | 838 gfx::Rect BrowserView::GetRestoredBounds() const { |
835 gfx::Rect bounds; | 839 gfx::Rect bounds; |
836 ui::WindowShowState state; | 840 ui::WindowShowState state; |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2502 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2499 gfx::Point icon_bottom( | 2503 gfx::Point icon_bottom( |
2500 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2504 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2501 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2505 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2502 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2506 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
2503 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2507 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2504 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2508 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2505 } | 2509 } |
2506 return top_arrow_height; | 2510 return top_arrow_height; |
2507 } | 2511 } |
OLD | NEW |