OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef UI_DISPLAY_WIN_SCREEN_WIN_H_ | 5 #ifndef UI_DISPLAY_WIN_SCREEN_WIN_H_ |
6 #define UI_DISPLAY_WIN_SCREEN_WIN_H_ | 6 #define UI_DISPLAY_WIN_SCREEN_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 static int GetSystemMetricsForHwnd(HWND hwnd, int metric); | 95 static int GetSystemMetricsForHwnd(HWND hwnd, int metric); |
96 | 96 |
97 // Returns the result of GetSystemMetrics for |metric| in DIP. | 97 // Returns the result of GetSystemMetrics for |metric| in DIP. |
98 // Use this function if you need to work in DIP and can tolerate cascading | 98 // Use this function if you need to work in DIP and can tolerate cascading |
99 // rounding errors towards screen pixels. | 99 // rounding errors towards screen pixels. |
100 static int GetSystemMetricsInDIP(int metric); | 100 static int GetSystemMetricsInDIP(int metric); |
101 | 101 |
102 // Returns |hwnd|'s scale factor. | 102 // Returns |hwnd|'s scale factor. |
103 static float GetScaleFactorForHWND(HWND hwnd); | 103 static float GetScaleFactorForHWND(HWND hwnd); |
104 | 104 |
| 105 // Like GetMonitorScaleFactor() but ignores --force-device-scale-factor. |
| 106 static float GetUnforcedMonitorScaleFactor(HMONITOR monitor); |
| 107 |
105 // Returns the system's global scale factor, ignoring the value of | 108 // Returns the system's global scale factor, ignoring the value of |
106 // --force-device-scale-factor. Only use this if you are working with Windows | 109 // --force-device-scale-factor. Only use this if you are working with Windows |
107 // metrics global to the system. Otherwise you should call | 110 // metrics global to the system. Otherwise you should call |
108 // GetScaleFactorForHWND() to get the correct scale factor for the monitor | 111 // GetScaleFactorForHWND() to get the correct scale factor for the monitor |
109 // you are targeting. | 112 // you are targeting. |
110 static float GetSystemScaleFactor(); | 113 static float GetSystemScaleFactor(); |
111 | 114 |
112 // Returns the HWND associated with the NativeView. | 115 // Returns the HWND associated with the NativeView. |
113 virtual HWND GetHWNDFromNativeView(gfx::NativeView view) const; | 116 virtual HWND GetHWNDFromNativeView(gfx::NativeView view) const; |
114 | 117 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // This must be updated anytime |screen_win_displays_| is updated. | 196 // This must be updated anytime |screen_win_displays_| is updated. |
194 std::vector<Display> displays_; | 197 std::vector<Display> displays_; |
195 | 198 |
196 DISALLOW_COPY_AND_ASSIGN(ScreenWin); | 199 DISALLOW_COPY_AND_ASSIGN(ScreenWin); |
197 }; | 200 }; |
198 | 201 |
199 } // namespace win | 202 } // namespace win |
200 } // namespace display | 203 } // namespace display |
201 | 204 |
202 #endif // UI_DISPLAY_WIN_SCREEN_WIN_H_ | 205 #endif // UI_DISPLAY_WIN_SCREEN_WIN_H_ |
OLD | NEW |