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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1096773002: Switching Clank to use direction-based selection granularity strategy and adding a chrome flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unified_ALL_unchanged
Patch Set: Adding the new flag to LoginCustomFlags enum Created 5 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 | « content/public/common/content_switches.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 9e0c4207e80039bff552964d85310cd9972ffedf..2c2b627d108e53b22de1cf29e9510a37fd3cd3f1 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -761,6 +761,25 @@ void RenderViewImpl::Initialize(const ViewMsg_New_Params& params,
if (switches::IsTouchEditingEnabled())
webview()->settings()->setTouchEditingEnabled(true);
+#if defined(OS_ANDROID)
+ WebSettings::SelectionStrategyType selection_strategy_default =
+ WebSettings::SelectionStrategyType::Direction;
+#else
+ WebSettings::SelectionStrategyType selection_strategy_default =
+ WebSettings::SelectionStrategyType::Character;
+#endif
+
+ WebSettings::SelectionStrategyType selection_strategy =
+ selection_strategy_default;
+ const std::string selection_strategy_str =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kTouchTextSelectionStrategy);
+ if (selection_strategy_str == "character")
+ selection_strategy = WebSettings::SelectionStrategyType::Character;
+ else if (selection_strategy_str == "direction")
+ selection_strategy = WebSettings::SelectionStrategyType::Direction;
+ webview()->settings()->setSelectionStrategy(selection_strategy);
+
if (!params.frame_name.empty())
webview()->mainFrame()->setName(params.frame_name);
« no previous file with comments | « content/public/common/content_switches.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698