Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: ui/display/win/screen_win.h

Issue 2695523002: Fix font sizes being incorrect when using --force-device-scale-factor. (Closed)
Patch Set: fix test link Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/display/win/dpi.cc ('k') | ui/display/win/screen_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // 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
107 // metrics global to the system. Otherwise you should call
108 // GetScaleFactorForHWND() to get the correct scale factor for the monitor
109 // you are targeting.
110 static float GetSystemScaleFactor();
111
105 // Returns the HWND associated with the NativeView. 112 // Returns the HWND associated with the NativeView.
106 virtual HWND GetHWNDFromNativeView(gfx::NativeView window) const; 113 virtual HWND GetHWNDFromNativeView(gfx::NativeView window) const;
107 114
108 // Returns the NativeView associated with the HWND. 115 // Returns the NativeView associated with the HWND.
109 virtual gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; 116 virtual gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const;
110 117
111 protected: 118 protected:
112 // Screen: 119 // Screen:
113 gfx::Point GetCursorScreenPoint() override; 120 gfx::Point GetCursorScreenPoint() override;
114 bool IsWindowUnderCursor(gfx::NativeWindow window) override; 121 bool IsWindowUnderCursor(gfx::NativeWindow window) override;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // This must be updated anytime |screen_win_displays_| is updated. 193 // This must be updated anytime |screen_win_displays_| is updated.
187 std::vector<Display> displays_; 194 std::vector<Display> displays_;
188 195
189 DISALLOW_COPY_AND_ASSIGN(ScreenWin); 196 DISALLOW_COPY_AND_ASSIGN(ScreenWin);
190 }; 197 };
191 198
192 } // namespace win 199 } // namespace win
193 } // namespace display 200 } // namespace display
194 201
195 #endif // UI_DISPLAY_WIN_SCREEN_WIN_H_ 202 #endif // UI_DISPLAY_WIN_SCREEN_WIN_H_
OLDNEW
« no previous file with comments | « ui/display/win/dpi.cc ('k') | ui/display/win/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698