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

Unified 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: 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.mm
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.mm
new file mode 100644
index 0000000000000000000000000000000000000000..b9a024b97f8d13db95250d0a817b3155565d9b86
--- /dev/null
+++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.mm
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.h"
+
+#import <UIKit/UIGestureRecognizerSubclass.h>
+
+#include "base/mac/scoped_nsobject.h"
+
+@interface OverscrollActionsGestureRecognizer () {
+ 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.
+ SEL action_;
+}
+@end
+
+@implementation OverscrollActionsGestureRecognizer
+
+- (instancetype)initWithTarget:(id)target action:(SEL)action {
+ self = [super initWithTarget:target action:action];
+ if (self) {
+ target_.reset([target retain]);
+ action_ = action;
+ }
+ return self;
+}
+
+- (void)reset {
+ [super reset];
+ [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
+}
+
+@end
« 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