OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 @implementation NSView (ChromeAdditions) | 7 @implementation NSView (ChromeAdditions) |
8 | 8 |
9 - (CGFloat)cr_lineWidth { | 9 - (CGFloat)cr_lineWidth { |
10 return 1.0 / [self convertSizeToBase:NSMakeSize(1, 1)].width; | 10 return 1.0 / [self convertSizeToBase:NSMakeSize(1, 1)].width; |
11 } | 11 } |
12 | 12 |
| 13 - (BOOL)cr_isMouseInView { |
| 14 NSPoint mouseLoc = [[self window] mouseLocationOutsideOfEventStream]; |
| 15 mouseLoc = [[self superview] convertPoint:mouseLoc fromView:nil]; |
| 16 return [self hitTest:mouseLoc] == self; |
| 17 } |
| 18 |
13 @end | 19 @end |
OLD | NEW |