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

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

Issue 10917270: linux_aura: Make X11 selection buffers work on text in both direction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove check Created 8 years, 3 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/render_widget_host_view_aura.h ('k') | ui/base/clipboard/clipboard.h » ('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_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 a590fd7651d3557fdba3279b0a49084723275d96..33960dfb629e62037c83acf26590890118f5768a 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -37,6 +37,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
+#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/events/event.h"
#include "ui/base/gestures/gesture_recognizer.h"
#include "ui/base/hit_test.h"
@@ -525,6 +526,23 @@ void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) {
aura::client::GetTooltipClient(root_window)->UpdateTooltip(window_);
}
+void RenderWidgetHostViewAura::SelectionChanged(const string16& text,
+ size_t offset,
+ const ui::Range& range) {
+ RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
+
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+ if (text.empty() || range.is_empty())
+ return;
+
+ // Set the BUFFER_SELECTION to the ui::Clipboard.
+ ui::ScopedClipboardWriter clipboard_writer(
+ ui::Clipboard::GetForCurrentThread(),
+ ui::Clipboard::BUFFER_SELECTION);
+ clipboard_writer.WriteText(text);
+#endif // defined(USE_X11) && !defined(OS_CHROMEOS)
+}
+
void RenderWidgetHostViewAura::SelectionBoundsChanged(
const gfx::Rect& start_rect,
WebKit::WebTextDirection start_direction,
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | ui/base/clipboard/clipboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698