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

Side by Side Diff: ios/web/web_state/ui/crw_touch_tracking_recognizer.mm

Issue 1048613002: Upstream ios/web/web_state/ui support classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang format Created 5 years, 8 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/web/web_state/ui/crw_touch_tracking_recognizer.h"
6
7 @interface CRWTouchTrackingRecognizer () <UIGestureRecognizerDelegate> {
8 __weak id<CRWTouchTrackingDelegate> _delegate;
9 }
10 @end
11
12 @implementation CRWTouchTrackingRecognizer
13
14 @synthesize touchTrackingDelegate = _delegate;
15
16 - (id)initWithDelegate:(id<CRWTouchTrackingDelegate>)delegate {
17 if ((self = [super init])) {
18 _delegate = delegate;
19 self.delegate = self;
20 }
21 return self;
22 }
23
24 #pragma mark -
25 #pragma mark UIGestureRecognizer Methods
26
27 - (void)reset {
28 [super reset];
29 }
30
31 - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
32 [super touchesBegan:touches withEvent:event];
33 [_delegate touched:YES];
34 }
35
36 - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event {
37 [super touchesMoved:touches withEvent:event];
38 }
39
40 - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
41 [super touchesEnded:touches withEvent:event];
42 self.state = UIGestureRecognizerStateFailed;
43 [_delegate touched:NO];
44 }
45
46 - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event {
47 [super touchesCancelled:touches withEvent:event];
48 [_delegate touched:NO];
49 }
50
51 #pragma mark -
52 #pragma mark UIGestureRecognizerDelegate Method
53
54 - (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer
55 shouldRecognizeSimultaneouslyWithGestureRecognizer:
56 (UIGestureRecognizer*)otherGestureRecognizer {
57 return YES;
58 }
59
60 @end
OLDNEW
« no previous file with comments | « ios/web/web_state/ui/crw_touch_tracking_recognizer.h ('k') | ios/web/web_state/ui/crw_ui_simple_web_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698