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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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 | 106 // --force-device-scale-factor. Only use this if you are working with Windows |
107 // metrics global to the system. Otherwise you should call | 107 // metrics global to the system. Otherwise you should call |
108 // GetScaleFactorForHWND() to get the correct scale factor for the monitor | 108 // GetScaleFactorForHWND() to get the correct scale factor for the monitor |
109 // you are targeting. | 109 // you are targeting. |
110 static float GetSystemScaleFactor(); | 110 static float GetSystemScaleFactor(); |
111 | 111 |
112 // Returns the HWND associated with the NativeView. | 112 // Returns the HWND associated with the NativeView. |
113 virtual HWND GetHWNDFromNativeView(gfx::NativeView window) const; | 113 virtual HWND GetHWNDFromNativeView(gfx::NativeView view) const; |
114 | 114 |
115 // Returns the NativeView associated with the HWND. | 115 // Returns the NativeView associated with the HWND. |
116 virtual gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; | 116 virtual gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; |
117 | 117 |
118 protected: | 118 protected: |
119 // Screen: | 119 // Screen: |
120 gfx::Point GetCursorScreenPoint() override; | 120 gfx::Point GetCursorScreenPoint() override; |
121 bool IsWindowUnderCursor(gfx::NativeWindow window) override; | 121 bool IsWindowUnderCursor(gfx::NativeWindow window) override; |
122 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; | 122 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; |
123 int GetNumDisplays() const override; | 123 int GetNumDisplays() const override; |
124 const std::vector<Display>& GetAllDisplays() const override; | 124 const std::vector<Display>& GetAllDisplays() const override; |
125 Display GetDisplayNearestWindow(gfx::NativeView window) const override; | 125 Display GetDisplayNearestWindow(gfx::NativeWindow window) const override; |
126 Display GetDisplayNearestPoint(const gfx::Point& point) const override; | 126 Display GetDisplayNearestPoint(const gfx::Point& point) const override; |
127 Display GetDisplayMatching(const gfx::Rect& match_rect) const override; | 127 Display GetDisplayMatching(const gfx::Rect& match_rect) const override; |
128 Display GetPrimaryDisplay() const override; | 128 Display GetPrimaryDisplay() const override; |
129 void AddObserver(DisplayObserver* observer) override; | 129 void AddObserver(DisplayObserver* observer) override; |
130 void RemoveObserver(DisplayObserver* observer) override; | 130 void RemoveObserver(DisplayObserver* observer) override; |
131 gfx::Rect ScreenToDIPRectInWindow( | 131 gfx::Rect ScreenToDIPRectInWindow( |
132 gfx::NativeView view, const gfx::Rect& screen_rect) const override; | 132 gfx::NativeView view, const gfx::Rect& screen_rect) const override; |
133 gfx::Rect DIPToScreenRectInWindow( | 133 gfx::Rect DIPToScreenRectInWindow( |
134 gfx::NativeView view, const gfx::Rect& dip_rect) const override; | 134 gfx::NativeView view, const gfx::Rect& dip_rect) const override; |
135 | 135 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // This must be updated anytime |screen_win_displays_| is updated. | 193 // This must be updated anytime |screen_win_displays_| is updated. |
194 std::vector<Display> displays_; | 194 std::vector<Display> displays_; |
195 | 195 |
196 DISALLOW_COPY_AND_ASSIGN(ScreenWin); | 196 DISALLOW_COPY_AND_ASSIGN(ScreenWin); |
197 }; | 197 }; |
198 | 198 |
199 } // namespace win | 199 } // namespace win |
200 } // namespace display | 200 } // namespace display |
201 | 201 |
202 #endif // UI_DISPLAY_WIN_SCREEN_WIN_H_ | 202 #endif // UI_DISPLAY_WIN_SCREEN_WIN_H_ |
OLD | NEW |