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: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 516573003: Use platform slop/timeout values for selection handle tap detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 6 years, 4 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 | « content/browser/renderer_host/input/touch_selection_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index eaa2c5a255ab45b9cd8858db1a2d574d9397f426..dd3643cd0d67963e572c254c329d88bb02bf4c63 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -72,6 +72,7 @@
#include "ui/events/gesture_detection/motion_event.h"
#include "ui/gfx/android/device_display_info.h"
#include "ui/gfx/android/java_bitmap.h"
+#include "ui/gfx/android/view_configuration.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size_conversions.h"
@@ -195,6 +196,19 @@ scoped_ptr<OverscrollGlow> CreateOverscrollEffect(
content_view_core->GetDpiScale())));
}
+scoped_ptr<TouchSelectionController> CreateSelectionController(
+ TouchSelectionControllerClient* client,
+ ContentViewCore* content_view_core) {
+ DCHECK(client);
+ DCHECK(content_view_core);
+ int tap_timeout_ms = gfx::ViewConfiguration::GetTapTimeoutInMs();
+ int touch_slop_pixels = gfx::ViewConfiguration::GetTouchSlopInPixels();
+ return make_scoped_ptr(new TouchSelectionController(
+ client,
+ base::TimeDelta::FromMilliseconds(tap_timeout_ms),
+ touch_slop_pixels / content_view_core->GetDpiScale()));
+}
+
ui::GestureProvider::Config CreateGestureProviderConfig() {
ui::GestureProvider::Config config = ui::DefaultGestureProviderConfig();
config.disable_click_delay =
@@ -1630,7 +1644,7 @@ void RenderWidgetHostViewAndroid::SetContentViewCore(
WasResized();
if (!selection_controller_)
- selection_controller_.reset(new TouchSelectionController(this));
+ selection_controller_ = CreateSelectionController(this, content_view_core_);
if (overscroll_effect_enabled_ && !overscroll_effect_ &&
content_view_core_->GetWindowAndroid()->GetCompositor())
« no previous file with comments | « content/browser/renderer_host/input/touch_selection_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698