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

Unified Diff: ui/display/screen.cc

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: move unittest Created 4 years, 1 month 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/screen.h ('k') | ui/display/screen_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/screen.cc
diff --git a/ui/display/screen.cc b/ui/display/screen.cc
index 25f688219985aca631b5837818acaf34955a5a95..42aaf8b0d1c6942780f2acf8434b38bd4356df9c 100644
--- a/ui/display/screen.cc
+++ b/ui/display/screen.cc
@@ -46,4 +46,15 @@ gfx::Rect Screen::DIPToScreenRectInWindow(gfx::NativeView view,
return ScaleToEnclosingRect(dip_rect, scale);
}
+bool Screen::GetDisplayWithDisplayId(int64_t display_id,
+ display::Display* display) const {
+ for (const display::Display& display_in_list : GetAllDisplays()) {
+ if (display_in_list.id() == display_id) {
+ *display = display_in_list;
+ return true;
+ }
+ }
+ return false;
+}
+
} // namespace display
« no previous file with comments | « ui/display/screen.h ('k') | ui/display/screen_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698