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 #include "ui/gfx/screen_win.h" | 5 #include "ui/gfx/screen_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 ScreenWin::ScreenWin() | 87 ScreenWin::ScreenWin() |
88 : displays_(GetDisplays()) { | 88 : displays_(GetDisplays()) { |
89 SingletonHwnd::GetInstance()->AddObserver(this); | 89 SingletonHwnd::GetInstance()->AddObserver(this); |
90 } | 90 } |
91 | 91 |
92 ScreenWin::~ScreenWin() { | 92 ScreenWin::~ScreenWin() { |
93 SingletonHwnd::GetInstance()->RemoveObserver(this); | 93 SingletonHwnd::GetInstance()->RemoveObserver(this); |
94 } | 94 } |
95 | 95 |
96 bool ScreenWin::IsDIPEnabled() { | |
97 return GetDPIScale() > 1.0; | |
98 } | |
99 | |
100 gfx::Point ScreenWin::GetCursorScreenPoint() { | 96 gfx::Point ScreenWin::GetCursorScreenPoint() { |
101 POINT pt; | 97 POINT pt; |
102 GetCursorPos(&pt); | 98 GetCursorPos(&pt); |
103 gfx::Point cursor_pos_pixels(pt); | 99 gfx::Point cursor_pos_pixels(pt); |
104 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); | 100 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); |
105 } | 101 } |
106 | 102 |
107 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() { | 103 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() { |
108 POINT cursor_loc; | 104 POINT cursor_loc; |
109 HWND hwnd = GetCursorPos(&cursor_loc) ? WindowFromPoint(cursor_loc) : NULL; | 105 HWND hwnd = GetCursorPos(&cursor_loc) ? WindowFromPoint(cursor_loc) : NULL; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 NOTREACHED(); | 192 NOTREACHED(); |
197 return NULL; | 193 return NULL; |
198 } | 194 } |
199 | 195 |
200 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | 196 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
201 NOTREACHED(); | 197 NOTREACHED(); |
202 return NULL; | 198 return NULL; |
203 } | 199 } |
204 | 200 |
205 } // namespace gfx | 201 } // namespace gfx |
OLD | NEW |