Chromium Code Reviews| Index: ui/base/cocoa/base_view.mm |
| diff --git a/ui/base/cocoa/base_view.mm b/ui/base/cocoa/base_view.mm |
| index fdc58fcb0e32334a699056b21e89ca88ed29c4d7..afa14170983ebedc8a00c80d84bb615e6e4084ed 100644 |
| --- a/ui/base/cocoa/base_view.mm |
| +++ b/ui/base/cocoa/base_view.mm |
| @@ -78,6 +78,10 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection"; |
| return kEventNotHandled; |
| } |
| +- (void)forceTouchEvent:(NSEvent*)theEvent { |
| + // This method left intentionally blank. |
| +} |
| + |
| - (void)mouseDown:(NSEvent*)theEvent { |
| dragging_ = YES; |
| [self mouseEvent:theEvent]; |
| @@ -166,6 +170,19 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection"; |
| [super keyUp:theEvent]; |
| } |
| +- (void)pressureChangeWithEvent:(NSEvent*)theEvent { |
| + NSInteger newStage = [theEvent stage]; |
| + if (pressureEventStage_ == newStage) |
| + return; |
| + |
| + // Call the force touch event when the stages reaches |
| + // 2, which is the value for force touch |
|
Robert Sesek
2015/12/21 22:30:21
nit: punctuation.
spqchan
2016/01/06 22:52:31
Done.
|
| + if (newStage == 2) { |
| + [self forceTouchEvent:theEvent]; |
| + } |
| + pressureEventStage_ = newStage; |
| +} |
| + |
| - (void)flagsChanged:(NSEvent*)theEvent { |
| if ([self keyEvent:theEvent] != kEventHandled) |
| [super flagsChanged:theEvent]; |