Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_rec ognizer.h" | |
| 6 | |
| 7 #import <UIKit/UIGestureRecognizerSubclass.h> | |
| 8 | |
| 9 #include "base/mac/scoped_nsobject.h" | |
| 10 | |
| 11 @interface OverscrollActionsGestureRecognizer () { | |
| 12 base::scoped_nsprotocol<id> target_; | |
|
rohitrao (ping after 24h)
2017/04/12 12:25:57
This might be better as a weak pointer.
justincohen
2017/04/12 16:05:33
Done.
| |
| 13 SEL action_; | |
| 14 } | |
| 15 @end | |
| 16 | |
| 17 @implementation OverscrollActionsGestureRecognizer | |
| 18 | |
| 19 - (instancetype)initWithTarget:(id)target action:(SEL)action { | |
| 20 self = [super initWithTarget:target action:action]; | |
| 21 if (self) { | |
| 22 target_.reset([target retain]); | |
| 23 action_ = action; | |
| 24 } | |
| 25 return self; | |
| 26 } | |
| 27 | |
| 28 - (void)reset { | |
| 29 [super reset]; | |
| 30 [target_ performSelector:action_ withObject:self]; | |
|
rohitrao (ping after 24h)
2017/04/12 12:25:57
Does the order of these calls matter? Is it ok to
justincohen
2017/04/12 16:05:33
It shouldn't matter, as long as the panGesture: ca
| |
| 31 } | |
| 32 | |
| 33 @end | |
| OLD | NEW |