| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #include "ui/gfx/screen.h" | 137 #include "ui/gfx/screen.h" |
| 138 #elif defined(OS_WIN) // !defined(USE_AURA) | 138 #elif defined(OS_WIN) // !defined(USE_AURA) |
| 139 #include "chrome/browser/jumplist_win.h" | 139 #include "chrome/browser/jumplist_win.h" |
| 140 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 140 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
| 141 #include "ui/views/widget/native_widget_win.h" | 141 #include "ui/views/widget/native_widget_win.h" |
| 142 #include "ui/views/win/scoped_fullscreen_visibility.h" | 142 #include "ui/views/win/scoped_fullscreen_visibility.h" |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
| 146 #include "base/win/windows_version.h" | 146 #include "base/win/windows_version.h" |
| 147 #include "ui/base/win/dpi.h" |
| 147 #include "win8/util/win8_util.h" | 148 #include "win8/util/win8_util.h" |
| 148 #endif | 149 #endif |
| 149 | 150 |
| 150 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 151 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 151 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" | 152 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" |
| 152 #endif | 153 #endif |
| 153 | 154 |
| 154 using base::TimeDelta; | 155 using base::TimeDelta; |
| 155 using content::NativeWebKeyboardEvent; | 156 using content::NativeWebKeyboardEvent; |
| 156 using content::SSLStatus; | 157 using content::SSLStatus; |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 void BrowserView::SetStarredState(bool is_starred) { | 821 void BrowserView::SetStarredState(bool is_starred) { |
| 821 GetLocationBarView()->SetStarToggled(is_starred); | 822 GetLocationBarView()->SetStarToggled(is_starred); |
| 822 } | 823 } |
| 823 | 824 |
| 824 void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) { | 825 void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) { |
| 825 GetLocationBarView()->ZoomChangedForActiveTab( | 826 GetLocationBarView()->ZoomChangedForActiveTab( |
| 826 can_show_bubble && !toolbar_->IsWrenchMenuShowing()); | 827 can_show_bubble && !toolbar_->IsWrenchMenuShowing()); |
| 827 } | 828 } |
| 828 | 829 |
| 829 gfx::Rect BrowserView::GetRestoredBounds() const { | 830 gfx::Rect BrowserView::GetRestoredBounds() const { |
| 831 #if defined(OS_WIN) |
| 832 gfx::Rect bounds_in_pixels = frame_->GetRestoredBounds(); |
| 833 return ui::win::ScreenToDIPRect(bounds_in_pixels); |
| 834 #else |
| 830 return frame_->GetRestoredBounds(); | 835 return frame_->GetRestoredBounds(); |
| 836 #endif |
| 831 } | 837 } |
| 832 | 838 |
| 833 ui::WindowShowState BrowserView::GetRestoredState() const { | 839 ui::WindowShowState BrowserView::GetRestoredState() const { |
| 834 if (IsMaximized()) | 840 if (IsMaximized()) |
| 835 return ui::SHOW_STATE_MAXIMIZED; | 841 return ui::SHOW_STATE_MAXIMIZED; |
| 836 if (IsMinimized()) | 842 if (IsMinimized()) |
| 837 return ui::SHOW_STATE_MINIMIZED; | 843 return ui::SHOW_STATE_MINIMIZED; |
| 838 return ui::SHOW_STATE_NORMAL; | 844 return ui::SHOW_STATE_NORMAL; |
| 839 } | 845 } |
| 840 | 846 |
| 841 gfx::Rect BrowserView::GetBounds() const { | 847 gfx::Rect BrowserView::GetBounds() const { |
| 848 #if defined(OS_WIN) |
| 849 gfx::Rect bounds_in_pixels = frame_->GetWindowBoundsInScreen(); |
| 850 return ui::win::ScreenToDIPRect(bounds_in_pixels); |
| 851 #else |
| 842 return frame_->GetWindowBoundsInScreen(); | 852 return frame_->GetWindowBoundsInScreen(); |
| 853 #endif |
| 843 } | 854 } |
| 844 | 855 |
| 845 bool BrowserView::IsMaximized() const { | 856 bool BrowserView::IsMaximized() const { |
| 846 return frame_->IsMaximized(); | 857 return frame_->IsMaximized(); |
| 847 } | 858 } |
| 848 | 859 |
| 849 bool BrowserView::IsMinimized() const { | 860 bool BrowserView::IsMinimized() const { |
| 850 return frame_->IsMinimized(); | 861 return frame_->IsMinimized(); |
| 851 } | 862 } |
| 852 | 863 |
| (...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2758 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2769 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2759 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2770 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2760 LocationBarView::kIconInternalPadding + 1); | 2771 LocationBarView::kIconInternalPadding + 1); |
| 2761 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2772 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2762 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2773 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2763 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2774 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2764 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2775 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2765 } | 2776 } |
| 2766 return top_arrow_height; | 2777 return top_arrow_height; |
| 2767 } | 2778 } |
| OLD | NEW |