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

Unified Diff: ui/display/mac/screen_mac.mm

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
Index: ui/display/mac/screen_mac.mm
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index fb25b0cd63699ee699349f036d8243920f8768f6..d51a5251d09e22169f16f93d0b75de0810a8ce9c 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -154,6 +154,10 @@ class ScreenMac : public Screen {
}
Display GetDisplayNearestWindow(gfx::NativeView view) const override {
+ return GetDisplayNearestView(view);
+ }
+
+ Display GetDisplayNearestView(gfx::NativeView view) const override {
EnsureDisplaysValid();
if (displays_.size() == 1)
return displays_[0];
@@ -329,6 +333,11 @@ class ScreenMac : public Screen {
} // namespace
+// static
+gfx::NativeWindow Screen::WindowForView(gfx::NativeView view) {
+ return [view window];
+}
+
#if !defined(USE_AURA)
Screen* CreateNativeScreen() {
return new ScreenMac;
« no previous file with comments | « ui/display/ios/screen_ios.mm ('k') | ui/display/screen.h » ('j') | ui/display/screen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698