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

Side by Side Diff: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.mm

Issue 2787723003: [Workaround] Notify Overscroll Actions that a gesture ended. (Closed)
Patch Set: v3 Created 3 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 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 #include "base/mac/scoped_nsobject.h"
justincohen 2017/04/05 14:22:07 sort?
9
10 @interface OverscrollActionsGestureRecognizer () {
11 base::scoped_nsprotocol<id> target_;
12 SEL action_;
13 }
14 @end
15
16 @implementation OverscrollActionsGestureRecognizer
17
18 - (instancetype)initWithTarget:(id)target action:(SEL)action {
19 self = [super initWithTarget:target action:action];
20 if (self) {
21 target_.reset([target retain]);
22 action_ = action;
23 }
24 return self;
25 }
26
27 - (void)reset {
28 [super reset];
29 [target_ performSelector:action_ withObject:self];
30 }
31
32 - (void)removeTarget:(id)target action:(SEL)action {
justincohen 2017/04/05 14:22:07 This is all voodoo to me. Why is this necessary?
33 [super removeTarget:target action:action];
34 if (target == target_) {
35 target_.reset();
36 }
37 }
38
39 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698