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

Unified Diff: ui/display/screen.h

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: WindowForView 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/mac/screen_mac.mm ('k') | ui/display/screen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/screen.h
diff --git a/ui/display/screen.h b/ui/display/screen.h
index 3bff5bdb6406f2bb5256fb552cb8642c5951b2dd..8ea02453b3735185581bd69d3797a7ae64f2ce88 100644
--- a/ui/display/screen.h
+++ b/ui/display/screen.h
@@ -58,8 +58,14 @@ class DISPLAY_EXPORT Screen {
// Returns the display nearest the specified window.
// If the window is NULL or the window is not rooted to a display this will
// return the primary display.
+ // TODO(jinsukkim): Fix the parameter type to |gfx::NativeWindow|.
tapted 2017/03/06 00:01:49 I think the CL is simple enough that we should pur
Jinsuk Kim 2017/03/06 06:06:19 No problem. Will add it when it gets actually put
virtual Display GetDisplayNearestWindow(gfx::NativeView view) const = 0;
+ // Returns the display nearest the specified view. It may still use the window
+ // that contains the view (i.e. if a window is spread over two displays,
+ // the location of the view within that window won't influence the result).
+ virtual Display GetDisplayNearestView(gfx::NativeView view) const;
+
// Returns the display nearest the specified point. |point| should be in DIPs.
virtual Display GetDisplayNearestPoint(const gfx::Point& point) const = 0;
@@ -91,6 +97,8 @@ class DISPLAY_EXPORT Screen {
bool GetDisplayWithDisplayId(int64_t display_id, Display* display) const;
private:
+ static gfx::NativeWindow WindowForView(gfx::NativeView view);
+
DISALLOW_COPY_AND_ASSIGN(Screen);
};
« no previous file with comments | « ui/display/mac/screen_mac.mm ('k') | ui/display/screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698