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

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

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Add test for JS cursor movement Created 3 years, 5 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: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 131f2c1007a7511e4081add2b14acd269caaa0d2..5770c26f2563e92bd0d72dc9506a20e265ed6e48 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2382,7 +2382,7 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
#if defined(USE_X11) && !defined(OS_CHROMEOS)
const TextInputManager::TextSelection* selection =
GetTextInputManager()->GetTextSelection(focused_view);
- if (selection->selected_text().length()) {
+ if (selection->selected_text().length() && selection->user_initiated()) {
// Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION);
clipboard_writer.WriteText(selection->selected_text());

Powered by Google App Engine
This is Rietveld 408576698