Chromium Code Reviews| 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 #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 |
| OLD | NEW |