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

Side by Side Diff: ui/gfx/screen_mac.mm

Issue 10389109: Add gfx::Screen::IsEnabled() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Decided that the original approach with gfx::Sceren::IsDIPEnabled is better than the ifdef Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/screen_gtk.cc ('k') | ui/gfx/screen_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/screen_gtk.cc ('k') | ui/gfx/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698