summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webview_impl.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 20:47:06 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 20:47:06 +0000
commitea8c745aa6a3be27b904060832fdf14bb11193bf (patch)
tree32ba371b6f4d59b7e8bcc987a2912aa645ba73a0 /webkit/glue/webview_impl.cc
parentac8e3525fa24068878ef8a45f35aba681f852cc9 (diff)
downloadchromium_src-ea8c745aa6a3be27b904060832fdf14bb11193bf.zip
chromium_src-ea8c745aa6a3be27b904060832fdf14bb11193bf.tar.gz
chromium_src-ea8c745aa6a3be27b904060832fdf14bb11193bf.tar.bz2
Paste from the x clipboard into webkit.
Review URL: http://codereview.chromium.org/51008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webview_impl.cc')
-rw-r--r--webkit/glue/webview_impl.cc29
1 files changed, 28 insertions, 1 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 15da11f..a79c63c 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -457,7 +457,7 @@ void WebViewImpl::MouseDown(const WebMouseEvent& event) {
if (clicked_node.get() && clicked_node == GetFocusedNode()) {
// Focus has not changed, show the autocomplete popup.
static_cast<EditorClientImpl*>(page_->editorClient())->
- ShowAutofillForNode(clicked_node.get());
+ ShowAutofillForNode(clicked_node.get());
}
// Dispatch the contextmenu event regardless of if the click was swallowed.
@@ -472,6 +472,21 @@ void WebViewImpl::MouseDown(const WebMouseEvent& event) {
if (event.button == WebMouseEvent::ButtonRight)
MouseContextMenu(event);
#endif
+
+#if defined(OS_LINUX)
+ // If the event was a middle click, attempt to copy text into the focused
+ // frame.
+ if (event.button == WebMouseEvent::ButtonMiddle) {
+ Frame* focused = GetFocusedWebCoreFrame();
+ if (!focused)
+ return;
+ Editor* editor = focused->editor();
+ if (!editor || !editor->canEdit())
+ return;
+
+ delegate_->PasteFromSelectionClipboard();
+ }
+#endif
}
void WebViewImpl::MouseContextMenu(const WebMouseEvent& event) {
@@ -1481,6 +1496,18 @@ void WebViewImpl::ResetZoom() {
main_frame()->frame()->isZoomFactorTextOnly());
}
+void WebViewImpl::InsertText(const string16& text) {
+ Frame* focused = GetFocusedWebCoreFrame();
+ if (!focused)
+ return;
+ Editor* editor = focused->editor();
+ if (!editor || !editor->canEdit())
+ return;
+
+ editor->insertTextWithoutSendingTextEvent(
+ webkit_glue::String16ToString(text), false, NULL);
+}
+
void WebViewImpl::CopyImageAt(int x, int y) {
if (!page_.get())
return;