Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: ui/base/cocoa/base_view.mm

Issue 1528153004: Look Up on Force Touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« third_party/WebKit/public/web/WebWidget.h ('K') | « ui/base/cocoa/base_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« third_party/WebKit/public/web/WebWidget.h ('K') | « ui/base/cocoa/base_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698