| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/display/screen.h" | 5 #include "ui/display/screen.h" |
| 6 | 6 |
| 7 #import <ApplicationServices/ApplicationServices.h> | 7 #import <ApplicationServices/ApplicationServices.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 NOTIMPLEMENTED(); | 138 NOTIMPLEMENTED(); |
| 139 return gfx::NativeWindow(); | 139 return gfx::NativeWindow(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 int GetNumDisplays() const override { return GetAllDisplays().size(); } | 142 int GetNumDisplays() const override { return GetAllDisplays().size(); } |
| 143 | 143 |
| 144 std::vector<Display> GetAllDisplays() const override { | 144 std::vector<Display> GetAllDisplays() const override { |
| 145 return displays_; | 145 return displays_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 Display GetDisplayNearestWindow(gfx::NativeView view) const override { | 148 Display GetDisplayNearestWindow(const gfx::NativeView view) const override { |
| 149 NSWindow* window = nil; | 149 NSWindow* window = nil; |
| 150 #if !defined(USE_AURA) | 150 #if !defined(USE_AURA) |
| 151 if (view) | 151 if (view) |
| 152 window = [view window]; | 152 window = [view window]; |
| 153 #endif | 153 #endif |
| 154 if (!window) | 154 if (!window) |
| 155 return GetPrimaryDisplay(); | 155 return GetPrimaryDisplay(); |
| 156 NSScreen* match_screen = [window screen]; | 156 NSScreen* match_screen = [window screen]; |
| 157 if (!match_screen) | 157 if (!match_screen) |
| 158 return GetPrimaryDisplay(); | 158 return GetPrimaryDisplay(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 } // namespace | 299 } // namespace |
| 300 | 300 |
| 301 #if !defined(USE_AURA) | 301 #if !defined(USE_AURA) |
| 302 Screen* CreateNativeScreen() { | 302 Screen* CreateNativeScreen() { |
| 303 return new ScreenMac; | 303 return new ScreenMac; |
| 304 } | 304 } |
| 305 #endif | 305 #endif |
| 306 | 306 |
| 307 } // namespace display | 307 } // namespace display |
| OLD | NEW |