Index: content/browser/renderer_host/render_widget_host_view_gtk.cc |
=================================================================== |
--- content/browser/renderer_host/render_widget_host_view_gtk.cc (revision 183210) |
+++ content/browser/renderer_host/render_widget_host_view_gtk.cc (working copy) |
@@ -36,7 +36,6 @@ |
#include "content/browser/renderer_host/render_view_host_delegate.h" |
#include "content/browser/renderer_host/render_view_host_impl.h" |
#include "content/common/gpu/gpu_messages.h" |
-#include "content/public/browser/browser_context.h" |
#include "content/public/browser/native_web_keyboard_event.h" |
#include "content/public/common/content_switches.h" |
#include "skia/ext/platform_canvas.h" |
@@ -44,7 +43,6 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFactory.h" |
-#include "ui/base/clipboard/scoped_clipboard_writer.h" |
#include "ui/base/gtk/gtk_compat.h" |
#include "ui/base/text/text_elider.h" |
#include "ui/base/x/active_window_watcher_x.h" |
@@ -944,13 +942,10 @@ |
return; |
} |
- BrowserContext* browser_context = host_->GetProcess()->GetBrowserContext(); |
- // Set the BUFFER_SELECTION to the ui::Clipboard. |
- ui::ScopedClipboardWriter clipboard_writer( |
- ui::Clipboard::GetForCurrentThread(), |
- ui::Clipboard::BUFFER_SELECTION, |
- BrowserContext::GetMarkerForOffTheRecordContext(browser_context)); |
- clipboard_writer.WriteText(text.substr(pos, n)); |
+ std::string utf8_selection = UTF16ToUTF8(text.substr(pos, n)); |
+ GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); |
+ gtk_clipboard_set_text( |
+ x_clipboard, utf8_selection.c_str(), utf8_selection.length()); |
} |
void RenderWidgetHostViewGtk::SelectionBoundsChanged( |