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

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

Issue 15870009: mac: Move more 10.7 api stuff into sdk_forward_declarations.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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/base/layout_mac.mm ('k') | ui/snapshot/snapshot_mac_unittest.mm » ('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 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/mac/sdk_forward_declarations.h"
11 #include "ui/gfx/display.h" 12 #include "ui/gfx/display.h"
12 13
13 #if !defined(MAC_OS_X_VERSION_10_7) || \
14 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
15
16 @interface NSScreen (LionAPI)
17 - (CGFloat)backingScaleFactor;
18 @end
19
20 #endif // 10.7
21
22 namespace { 14 namespace {
23 15
24 gfx::Rect ConvertCoordinateSystem(NSRect ns_rect) { 16 gfx::Rect ConvertCoordinateSystem(NSRect ns_rect) {
25 // Primary monitor is defined as the monitor with the menubar, 17 // Primary monitor is defined as the monitor with the menubar,
26 // which is always at index 0. 18 // which is always at index 0.
27 NSScreen* primary_screen = [[NSScreen screens] objectAtIndex:0]; 19 NSScreen* primary_screen = [[NSScreen screens] objectAtIndex:0];
28 float primary_screen_height = [primary_screen frame].size.height; 20 float primary_screen_height = [primary_screen frame].size.height;
29 gfx::Rect rect(NSRectToCGRect(ns_rect)); 21 gfx::Rect rect(NSRectToCGRect(ns_rect));
30 rect.set_y(primary_screen_height - rect.y() - rect.height()); 22 rect.set_y(primary_screen_height - rect.y() - rect.height());
31 return rect; 23 return rect;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 176
185 } // namespace 177 } // namespace
186 178
187 namespace gfx { 179 namespace gfx {
188 180
189 Screen* CreateNativeScreen() { 181 Screen* CreateNativeScreen() {
190 return new ScreenMac; 182 return new ScreenMac;
191 } 183 }
192 184
193 } 185 }
OLDNEW
« no previous file with comments | « ui/base/layout_mac.mm ('k') | ui/snapshot/snapshot_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698