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.
5 #import "ios/web/web_state/ui/crw_touch_tracking_recognizer.h"
7 @interface CRWTouchTrackingRecognizer () <UIGestureRecognizerDelegate> {
8 __weak id<CRWTouchTrackingDelegate> _delegate;
12 @implementation CRWTouchTrackingRecognizer
14 @synthesize touchTrackingDelegate = _delegate;
16 - (id)initWithDelegate:(id<CRWTouchTrackingDelegate>)delegate {
17 if ((self = [super init])) {
25 #pragma mark UIGestureRecognizer Methods
31 - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
32 [super touchesBegan:touches withEvent:event];
33 [_delegate touched:YES];
36 - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event {
37 [super touchesMoved:touches withEvent:event];
40 - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
41 [super touchesEnded:touches withEvent:event];
42 self.state = UIGestureRecognizerStateFailed;
43 [_delegate touched:NO];
46 - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event {
47 [super touchesCancelled:touches withEvent:event];
48 [_delegate touched:NO];
52 #pragma mark UIGestureRecognizerDelegate Method
54 - (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer
55 shouldRecognizeSimultaneouslyWithGestureRecognizer:
56 (UIGestureRecognizer*)otherGestureRecognizer {