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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 903143003: wip: Touch Text Selection Prototypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@selection_granularity_on_unified
Patch Set: Created 5 years, 10 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 | « chrome/browser/about_flags.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | 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 62538c8bb0e2639cd8ebc03dafb0957516e95255..c26ab8f2b46465e43743869c8d82ebd0a6245a1d 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -265,11 +265,20 @@ scoped_ptr<ui::TouchSelectionController> CreateSelectionController(
DCHECK(content_view_core);
int tap_timeout_ms = gfx::ViewConfiguration::GetTapTimeoutInMs();
int touch_slop_pixels = gfx::ViewConfiguration::GetTouchSlopInPixels();
+ ui::TextSelectionGranularityStrategy strategy =
+ ui::GRANULARITY_STRATEGY_DEFAULT;
+ const std::string strategy_str = base::CommandLine::ForCurrentProcess()->
+ GetSwitchValueASCII(switches::kTouchTextSelectionStrategy);
+ if (strategy_str == "1")
+ strategy = ui::GRANULARITY_STRATEGY_DIRECTION;
+ else if (strategy_str == "2")
+ strategy = ui::GRANULARITY_STRATEGY_VELOCITY;
return make_scoped_ptr(new ui::TouchSelectionController(
client,
base::TimeDelta::FromMilliseconds(tap_timeout_ms),
touch_slop_pixels / content_view_core->GetDpiScale(),
- false));
+ false,
+ strategy));
}
scoped_ptr<OverscrollControllerAndroid> CreateOverscrollController(
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698