| 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/gfx/screen.h" | 5 #include "ui/gfx/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 | 9 |
| 10 @interface NSScreen (LionAPI) | 10 @interface NSScreen (LionAPI) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 scale = [screen userSpaceScaleFactor]; | 68 scale = [screen userSpaceScaleFactor]; |
| 69 monitor.set_device_scale_factor(scale); | 69 monitor.set_device_scale_factor(scale); |
| 70 return monitor; | 70 return monitor; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 namespace gfx { | 75 namespace gfx { |
| 76 | 76 |
| 77 // static | 77 // static |
| 78 bool Screen::IsDIPEnabled() { |
| 79 return false; |
| 80 } |
| 81 |
| 82 // static |
| 78 gfx::Point Screen::GetCursorScreenPoint() { | 83 gfx::Point Screen::GetCursorScreenPoint() { |
| 79 NSPoint mouseLocation = [NSEvent mouseLocation]; | 84 NSPoint mouseLocation = [NSEvent mouseLocation]; |
| 80 // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. | 85 // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. |
| 81 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 86 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
| 82 mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y; | 87 mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y; |
| 83 return gfx::Point(mouseLocation.x, mouseLocation.y); | 88 return gfx::Point(mouseLocation.x, mouseLocation.y); |
| 84 } | 89 } |
| 85 | 90 |
| 86 // static | 91 // static |
| 87 gfx::Monitor Screen::GetPrimaryMonitor() { | 92 gfx::Monitor Screen::GetPrimaryMonitor() { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // The primary display in a mirrored set will be counted, but those that | 132 // The primary display in a mirrored set will be counted, but those that |
| 128 // mirror it will not be. | 133 // mirror it will not be. |
| 129 ++display_count; | 134 ++display_count; |
| 130 } | 135 } |
| 131 } | 136 } |
| 132 | 137 |
| 133 return display_count; | 138 return display_count; |
| 134 } | 139 } |
| 135 | 140 |
| 136 } // namespace gfx | 141 } // namespace gfx |
| OLD | NEW |