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

Unified Diff: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
index 7a58ef157bff2484b87c895961b8c20b4196b8d5..b1049d4f0bc8f247c8fb29fb212aaf18c8a98311 100644
--- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
+++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
@@ -12,6 +12,7 @@
#include "base/mac/scoped_nsobject.h"
#include "base/metrics/histogram_macros.h"
#import "ios/chrome/browser/ui/browser_view_controller.h"
+#import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_gesture_recognizer.h"
#import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h"
#include "ios/chrome/browser/ui/rtl_geometry.h"
#import "ios/chrome/browser/ui/toolbar/toolbar_controller.h"
@@ -574,9 +575,18 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
}
- (void)setup {
- base::scoped_nsobject<UIPanGestureRecognizer> panGesture(
- [[UIPanGestureRecognizer alloc] initWithTarget:self
- action:@selector(panGesture:)]);
+ base::scoped_nsobject<UIPanGestureRecognizer> panGesture;
+ // Workaround a bug occuring when Speak Selection is enabled.
+ // See crbug.com/699655.
+ if (UIAccessibilityIsSpeakSelectionEnabled()) {
+ panGesture.reset([[OverscrollActionsGestureRecognizer alloc]
+ initWithTarget:self
+ action:@selector(panGesture:)]);
+ } else {
+ panGesture.reset([[UIPanGestureRecognizer alloc]
+ initWithTarget:self
+ action:@selector(panGesture:)]);
+ }
[panGesture setMaximumNumberOfTouches:1];
[panGesture setDelegate:self];
[[self scrollView] addGestureRecognizer:panGesture];

Powered by Google App Engine
This is Rietveld 408576698