| 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 #include "ui/base/cocoa/base_view.h" | 5 #include "ui/base/cocoa/base_view.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 | 8 |
| 9 NSString* kViewDidBecomeFirstResponder = | 9 NSString* kViewDidBecomeFirstResponder = |
| 10 @"Chromium.kViewDidBecomeFirstResponder"; | 10 @"Chromium.kViewDidBecomeFirstResponder"; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 - (void)updateTrackingAreas { | 56 - (void)updateTrackingAreas { |
| 57 [super updateTrackingAreas]; | 57 [super updateTrackingAreas]; |
| 58 | 58 |
| 59 // NSTrackingInVisibleRect doesn't work correctly with Lion's window resizing, | 59 // NSTrackingInVisibleRect doesn't work correctly with Lion's window resizing, |
| 60 // http://crbug.com/176725 / http://openradar.appspot.com/radar?id=2773401 . | 60 // http://crbug.com/176725 / http://openradar.appspot.com/radar?id=2773401 . |
| 61 // Work around it by reinstalling the tracking area after window resize. | 61 // Work around it by reinstalling the tracking area after window resize. |
| 62 // This AppKit bug is fixed on Yosemite, so we only apply this workaround on | 62 // This AppKit bug is fixed on Yosemite, so we only apply this workaround on |
| 63 // 10.9. | 63 // 10.9. |
| 64 if (base::mac::IsOSMavericks()) { | 64 if (base::mac::IsOS10_9()) { |
| 65 [self disableTracking]; | 65 [self disableTracking]; |
| 66 [self enableTracking]; | 66 [self enableTracking]; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 - (void)mouseEvent:(NSEvent*)theEvent { | 70 - (void)mouseEvent:(NSEvent*)theEvent { |
| 71 // This method left intentionally blank. | 71 // This method left intentionally blank. |
| 72 } | 72 } |
| 73 | 73 |
| 74 - (EventHandled)keyEvent:(NSEvent*)theEvent { | 74 - (EventHandled)keyEvent:(NSEvent*)theEvent { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return new_rect; | 194 return new_rect; |
| 195 } | 195 } |
| 196 | 196 |
| 197 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { | 197 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { |
| 198 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); | 198 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); |
| 199 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect); | 199 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect); |
| 200 return new_rect; | 200 return new_rect; |
| 201 } | 201 } |
| 202 | 202 |
| 203 @end | 203 @end |
| OLD | NEW |