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

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

Issue 2747143005: Revert of Add display::GetDisplayNearestView (Closed)
Patch Set: 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
« no previous file with comments | « ui/display/ios/screen_ios.mm ('k') | ui/display/screen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/mac/screen_mac.mm
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 060d3108ce1195aab0a2b5d5ce46bf253d410fa4..fb25b0cd63699ee699349f036d8243920f8768f6 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -153,11 +153,16 @@
return displays_;
}
- Display GetDisplayNearestWindow(gfx::NativeWindow window) const override {
+ Display GetDisplayNearestWindow(gfx::NativeView view) 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();
@@ -324,15 +329,6 @@
} // 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;
« no previous file with comments | « ui/display/ios/screen_ios.mm ('k') | ui/display/screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698