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 | |
83 gfx::Point Screen::GetCursorScreenPoint() { | 78 gfx::Point Screen::GetCursorScreenPoint() { |
84 NSPoint mouseLocation = [NSEvent mouseLocation]; | 79 NSPoint mouseLocation = [NSEvent mouseLocation]; |
85 // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. | 80 // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. |
86 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 81 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
87 mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y; | 82 mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y; |
88 return gfx::Point(mouseLocation.x, mouseLocation.y); | 83 return gfx::Point(mouseLocation.x, mouseLocation.y); |
89 } | 84 } |
90 | 85 |
91 // static | 86 // static |
92 gfx::Monitor Screen::GetPrimaryMonitor() { | 87 gfx::Monitor Screen::GetPrimaryMonitor() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // The primary display in a mirrored set will be counted, but those that | 127 // The primary display in a mirrored set will be counted, but those that |
133 // mirror it will not be. | 128 // mirror it will not be. |
134 ++display_count; | 129 ++display_count; |
135 } | 130 } |
136 } | 131 } |
137 | 132 |
138 return display_count; | 133 return display_count; |
139 } | 134 } |
140 | 135 |
141 } // namespace gfx | 136 } // namespace gfx |
OLD | NEW |