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

Unified Diff: ui/display/display_finder.h

Issue 2730413002: Moves FindDisplayIndexContainingPoint into display (Closed)
Patch Set: comment 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
Index: ui/display/display_finder.h
diff --git a/ui/display/display_finder.h b/ui/display/display_finder.h
index d63925923c77b719100caffa4917b16424065598..b66f044f5cc6a151b02fd482d10a9ef9418e2e21 100644
--- a/ui/display/display_finder.h
+++ b/ui/display/display_finder.h
@@ -17,7 +17,8 @@ class Rect;
namespace display {
class Display;
-// Returns the display in |displays| closest to |point|.
+// Returns the display containing |point|. If no displays contain |point|, then
+// this returns the display closest to |point|.
DISPLAY_EXPORT const Display* FindDisplayNearestPoint(
const std::vector<Display>& displays,
const gfx::Point& point);
@@ -28,6 +29,12 @@ DISPLAY_EXPORT const Display* FindDisplayWithBiggestIntersection(
const std::vector<Display>& displays,
const gfx::Rect& rect);
+// Returns the index in |displays| whose bounds contains |point_in_screen|.
+// Returns -1 if no such Display contains |point_in_screen|.
+DISPLAY_EXPORT int FindDisplayIndexContainingPoint(
kylechar 2017/03/06 18:00:20 Would it be "more" correct to return an iterator i
sky 2017/03/06 18:22:00 I just copy/pasted the code. But I agree, an itera
+ const std::vector<Display>& displays,
+ const gfx::Point& point_in_screen);
+
} // namespace display
#endif // UI_DISPLAY_DISPLAY_FINDER_H_

Powered by Google App Engine
This is Rietveld 408576698