| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 if (base::mac::IsOSMavericks()) { | 64 if (base::mac::IsOSMavericks()) { |
| 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 - (void)tabletEvent:(NSEvent*)theEvent { |
| 75 // This method left intentionally blank. |
| 76 } |
| 77 |
| 74 - (EventHandled)keyEvent:(NSEvent*)theEvent { | 78 - (EventHandled)keyEvent:(NSEvent*)theEvent { |
| 75 // The default implementation of this method does not handle any key events. | 79 // The default implementation of this method does not handle any key events. |
| 76 // Derived classes should return kEventHandled if they handled an event, | 80 // Derived classes should return kEventHandled if they handled an event, |
| 77 // otherwise it will be forwarded on to |super|. | 81 // otherwise it will be forwarded on to |super|. |
| 78 return kEventNotHandled; | 82 return kEventNotHandled; |
| 79 } | 83 } |
| 80 | 84 |
| 81 - (void)forceTouchEvent:(NSEvent*)theEvent { | 85 - (void)forceTouchEvent:(NSEvent*)theEvent { |
| 82 // This method left intentionally blank. | 86 // This method left intentionally blank. |
| 83 } | 87 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // how the event flow for drags should work. This stores the exit event, and | 157 // how the event flow for drags should work. This stores the exit event, and |
| 154 // sends it when the drag completes instead. | 158 // sends it when the drag completes instead. |
| 155 if (dragging_) { | 159 if (dragging_) { |
| 156 pendingExitEvent_.reset([theEvent retain]); | 160 pendingExitEvent_.reset([theEvent retain]); |
| 157 return; | 161 return; |
| 158 } | 162 } |
| 159 | 163 |
| 160 [self mouseEvent:theEvent]; | 164 [self mouseEvent:theEvent]; |
| 161 } | 165 } |
| 162 | 166 |
| 167 - (void)tabletProximity:(NSEvent*)theEvent { |
| 168 [self tabletEvent:theEvent]; |
| 169 } |
| 170 |
| 163 - (void)keyDown:(NSEvent*)theEvent { | 171 - (void)keyDown:(NSEvent*)theEvent { |
| 164 if ([self keyEvent:theEvent] != kEventHandled) | 172 if ([self keyEvent:theEvent] != kEventHandled) |
| 165 [super keyDown:theEvent]; | 173 [super keyDown:theEvent]; |
| 166 } | 174 } |
| 167 | 175 |
| 168 - (void)keyUp:(NSEvent*)theEvent { | 176 - (void)keyUp:(NSEvent*)theEvent { |
| 169 if ([self keyEvent:theEvent] != kEventHandled) | 177 if ([self keyEvent:theEvent] != kEventHandled) |
| 170 [super keyUp:theEvent]; | 178 [super keyUp:theEvent]; |
| 171 } | 179 } |
| 172 | 180 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 194 return new_rect; | 202 return new_rect; |
| 195 } | 203 } |
| 196 | 204 |
| 197 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { | 205 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { |
| 198 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); | 206 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); |
| 199 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect); | 207 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect); |
| 200 return new_rect; | 208 return new_rect; |
| 201 } | 209 } |
| 202 | 210 |
| 203 @end | 211 @end |
| OLD | NEW |