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

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

Issue 2817483002: [Workaround] Notify Overscroll Actions that a gesture ended. (Closed)
Patch Set: Add back removeTarget, use weak protocol 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
« no previous file with comments | « ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
9 #import "base/ios/weak_nsobject.h"
10
11 @interface OverscrollActionsGestureRecognizer () {
12 base::WeakNSProtocol<id> target_;
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];
31 }
32
33 - (void)removeTarget:(id)target action:(SEL)action {
34 DCHECK(target != target_);
35 [super removeTarget:target action:action];
36 }
37
38 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698