| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 #import "ios/chrome/browser/ui/stack_view/card_stack_pinch_gesture_recognizer.h" | 5 #import "ios/chrome/browser/ui/stack_view/card_stack_pinch_gesture_recognizer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
| 10 #error "This file requires ARC support." | |
| 11 #endif | |
| 12 | |
| 13 @interface CardStackPinchGestureRecognizer () | 9 @interface CardStackPinchGestureRecognizer () |
| 14 | 10 |
| 15 // Returns the number of non-ended, non-cancelled touches in |event|. | 11 // Returns the number of non-ended, non-cancelled touches in |event|. |
| 16 - (NSUInteger)numberOfActiveTouchesInEvent:(UIEvent*)event; | 12 - (NSUInteger)numberOfActiveTouchesInEvent:(UIEvent*)event; |
| 17 | 13 |
| 18 @end | 14 @end |
| 19 | 15 |
| 20 @implementation CardStackPinchGestureRecognizer | 16 @implementation CardStackPinchGestureRecognizer |
| 21 | 17 |
| 22 @synthesize numberOfActiveTouches = numberOfActiveTouches_; | 18 @synthesize numberOfActiveTouches = numberOfActiveTouches_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 NSUInteger count = 0; | 51 NSUInteger count = 0; |
| 56 for (UITouch* touch in [event touchesForGestureRecognizer:self]) { | 52 for (UITouch* touch in [event touchesForGestureRecognizer:self]) { |
| 57 if (touch.phase == UITouchPhaseBegan || touch.phase == UITouchPhaseMoved || | 53 if (touch.phase == UITouchPhaseBegan || touch.phase == UITouchPhaseMoved || |
| 58 touch.phase == UITouchPhaseStationary) | 54 touch.phase == UITouchPhaseStationary) |
| 59 count++; | 55 count++; |
| 60 } | 56 } |
| 61 return count; | 57 return count; |
| 62 } | 58 } |
| 63 | 59 |
| 64 @end | 60 @end |
| OLD | NEW |