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

Side by Side Diff: chrome/browser/ui/cocoa/nsview_additions.mm

Issue 10908074: mac: Use convertSizeFromBacking: instead of the deprecated ...FromBase: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 | « no previous file | ui/base/layout_mac.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 #import "chrome/browser/ui/cocoa/nsview_additions.h" 5 #import "chrome/browser/ui/cocoa/nsview_additions.h"
6 6
7 #if !defined(MAC_OS_X_VERSION_10_7) || \
8 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
9
10 @interface (LionAPI)
11 - (NSSize)convertSizeFromBacking:(NSSize)size;
12 @end
13
14 #endif // 10.7
15
7 @implementation NSView (ChromeAdditions) 16 @implementation NSView (ChromeAdditions)
8 17
9 - (CGFloat)cr_lineWidth { 18 - (CGFloat)cr_lineWidth {
10 // NOTE: This is a correct use of base coordinate system, to perform pixel 19 // All shipping retina macs run at least 10.7.
Avi (use Gerrit) 2012/09/04 20:17:23 therefore, that's the minimum system we support Hi
11 // alignment. 20 if (![self respondsToSelector:@selector(convertSizeFromBacking:)])
12 return [self convertSizeFromBase:NSMakeSize(1, 1)].width; 21 return 1;
22 return [self convertSizeFromBacking:NSMakeSize(1, 1)].width;
13 } 23 }
14 24
15 - (BOOL)cr_isMouseInView { 25 - (BOOL)cr_isMouseInView {
16 NSPoint mouseLoc = [[self window] mouseLocationOutsideOfEventStream]; 26 NSPoint mouseLoc = [[self window] mouseLocationOutsideOfEventStream];
17 mouseLoc = [[self superview] convertPoint:mouseLoc fromView:nil]; 27 mouseLoc = [[self superview] convertPoint:mouseLoc fromView:nil];
18 return [self hitTest:mouseLoc] == self; 28 return [self hitTest:mouseLoc] == self;
19 } 29 }
20 30
21 @end 31 @end
OLDNEW
« no previous file with comments | « no previous file | ui/base/layout_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698