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

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

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: test GetDisplayNearestView Created 3 years, 9 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/screen_win.h ('k') | ui/message_center/views/toast_contents_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.cc
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc
index 636eb90dc3add9da339676e9612aba3990aeeaae..912ef96cf3a71f2611e57f08d3acb099342c8c29 100644
--- a/ui/display/win/screen_win.cc
+++ b/ui/display/win/screen_win.cc
@@ -406,6 +406,16 @@ Display ScreenWin::GetDisplayNearestWindow(gfx::NativeView window) const {
return screen_win_display.display();
}
+Display GetDisplayNearestView(gfx::NativeView view) const {
+ HWND window_hwnd = GetHWNDFromNativeView(view);
+ if (!window_hwnd) {
+ return GetPrimaryDisplay();
+ }
+ ScreenWinDisplay screen_win_display =
+ GetScreenWinDisplayNearestHWND(window_hwnd);
+ return screen_win_display.display();
+}
tapted 2017/03/09 00:47:42 This is identical to GetDisplayNearestWindow. Is t
Jinsuk Kim 2017/03/09 01:56:17 Right this is not necessary since Windows always u
+
Display ScreenWin::GetDisplayNearestPoint(const gfx::Point& point) const {
gfx::Point screen_point(DIPToScreenPoint(point));
ScreenWinDisplay screen_win_display =
« no previous file with comments | « ui/display/win/screen_win.h ('k') | ui/message_center/views/toast_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698