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..060d3108ce1195aab0a2b5d5ce46bf253d410fa4 100644 |
--- a/ui/display/mac/screen_mac.mm |
+++ b/ui/display/mac/screen_mac.mm |
@@ -153,16 +153,11 @@ class ScreenMac : public Screen { |
return displays_; |
} |
- Display GetDisplayNearestWindow(gfx::NativeView view) const override { |
+ Display GetDisplayNearestWindow(gfx::NativeWindow window) const override { |
EnsureDisplaysValid(); |
if (displays_.size() == 1) |
return displays_[0]; |
- NSWindow* window = nil; |
-#if !defined(USE_AURA) |
- if (view) |
- window = [view window]; |
-#endif |
if (!window) |
return GetPrimaryDisplay(); |
@@ -329,6 +324,15 @@ class ScreenMac : public Screen { |
} // namespace |
+// static |
+gfx::NativeWindow Screen::GetWindowForView(gfx::NativeView view) { |
+ NSWindow* window = nil; |
+#if !defined(USE_AURA) |
+ window = [view window]; |
+#endif |
+ return window; |
+} |
+ |
#if !defined(USE_AURA) |
Screen* CreateNativeScreen() { |
return new ScreenMac; |