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

Unified Diff: ui/display/win/screen_win.h

Issue 2012083002: Multiple DPI Tracking for ScreenWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Feedback Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/win/scaling_util_unittest.cc ('k') | ui/display/win/screen_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.h
diff --git a/ui/display/win/screen_win.h b/ui/display/win/screen_win.h
index 51a221f6f65f190a30688c08d311c71a87284225..23bc57816074d951e652de8c97a5aeec4fb49b12 100644
--- a/ui/display/win/screen_win.h
+++ b/ui/display/win/screen_win.h
@@ -111,6 +111,10 @@ class DISPLAY_EXPORT ScreenWin : public display::Screen {
display::Display GetPrimaryDisplay() const override;
void AddObserver(display::DisplayObserver* observer) override;
void RemoveObserver(display::DisplayObserver* observer) override;
+ gfx::Rect ScreenToDIPRectInWindow(
+ gfx::NativeView view, const gfx::Rect& screen_rect) const override;
+ gfx::Rect DIPToScreenRectInWindow(
+ gfx::NativeView view, const gfx::Rect& dip_rect) const override;
void UpdateFromDisplayInfos(const std::vector<DisplayInfo>& display_infos);
@@ -138,11 +142,27 @@ class DISPLAY_EXPORT ScreenWin : public display::Screen {
ScreenWinDisplay GetScreenWinDisplayNearestScreenPoint(
const gfx::Point& screen_point) const;
+ // Returns the ScreenWinDisplay closest to or enclosing |dip_point|.
+ ScreenWinDisplay GetScreenWinDisplayNearestDIPPoint(
+ const gfx::Point& dip_point) const;
+
+ // Returns the ScreenWinDisplay closest to or enclosing |dip_rect|.
+ ScreenWinDisplay GetScreenWinDisplayNearestDIPRect(
+ const gfx::Rect& dip_rect) const;
+
// Returns the ScreenWinDisplay corresponding to the primary monitor.
ScreenWinDisplay GetPrimaryScreenWinDisplay() const;
ScreenWinDisplay GetScreenWinDisplay(const MONITORINFOEX& monitor_info) const;
+ static float GetScaleFactorForHWND(HWND hwnd);
+
+ // Returns the result of calling |getter| with |value| on the global
+ // ScreenWin if it exists, otherwise return the default ScreenWinDisplay.
+ template <typename Getter, typename GetterType>
+ static ScreenWinDisplay GetScreenWinDisplayVia(Getter getter,
+ GetterType value);
+
// Helper implementing the DisplayObserver handling.
DisplayChangeNotifier change_notifier_;
« no previous file with comments | « ui/display/win/scaling_util_unittest.cc ('k') | ui/display/win/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698