| 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 |
| 9 @interface CardStackPinchGestureRecognizer () | 13 @interface CardStackPinchGestureRecognizer () |
| 10 | 14 |
| 11 // Returns the number of non-ended, non-cancelled touches in |event|. | 15 // Returns the number of non-ended, non-cancelled touches in |event|. |
| 12 - (NSUInteger)numberOfActiveTouchesInEvent:(UIEvent*)event; | 16 - (NSUInteger)numberOfActiveTouchesInEvent:(UIEvent*)event; |
| 13 | 17 |
| 14 @end | 18 @end |
| 15 | 19 |
| 16 @implementation CardStackPinchGestureRecognizer | 20 @implementation CardStackPinchGestureRecognizer |
| 17 | 21 |
| 18 @synthesize numberOfActiveTouches = numberOfActiveTouches_; | 22 @synthesize numberOfActiveTouches = numberOfActiveTouches_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 NSUInteger count = 0; | 55 NSUInteger count = 0; |
| 52 for (UITouch* touch in [event touchesForGestureRecognizer:self]) { | 56 for (UITouch* touch in [event touchesForGestureRecognizer:self]) { |
| 53 if (touch.phase == UITouchPhaseBegan || touch.phase == UITouchPhaseMoved || | 57 if (touch.phase == UITouchPhaseBegan || touch.phase == UITouchPhaseMoved || |
| 54 touch.phase == UITouchPhaseStationary) | 58 touch.phase == UITouchPhaseStationary) |
| 55 count++; | 59 count++; |
| 56 } | 60 } |
| 57 return count; | 61 return count; |
| 58 } | 62 } |
| 59 | 63 |
| 60 @end | 64 @end |
| OLD | NEW |