summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:17:07 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:17:07 +0000
commit80ec6548d3f012c9b01e5dd5db39cb78c94c904b (patch)
treeae1f6db4a6f69844183f41c63c5b6a2e9742bd7c /chrome
parent6cbf718e873eca34359cae7c220c408385fbc0b1 (diff)
downloadchromium_src-80ec6548d3f012c9b01e5dd5db39cb78c94c904b.zip
chromium_src-80ec6548d3f012c9b01e5dd5db39cb78c94c904b.tar.gz
chromium_src-80ec6548d3f012c9b01e5dd5db39cb78c94c904b.tar.bz2
gtk: Update PRIMARY selection on Ctrl-X in omnibox.
We already do this when copying text; I forgot to do the same for cutting. BUG=33230 TEST=checked that both PRIMARY and CLIPBOARD get updated on Ctrl-X and Ctrl-C now (and cut via context menu) Review URL: http://codereview.chromium.org/555135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc6
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.h9
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 90094b5..e6d5f1f 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -253,6 +253,8 @@ void AutocompleteEditViewGtk::Init() {
G_CALLBACK(&HandleBackSpaceThunk), this);
g_signal_connect(text_view_, "copy-clipboard",
G_CALLBACK(&HandleCopyClipboardThunk), this);
+ g_signal_connect(text_view_, "cut-clipboard",
+ G_CALLBACK(&HandleCutClipboardThunk), this);
g_signal_connect(text_view_, "paste-clipboard",
G_CALLBACK(&HandlePasteClipboardThunk), this);
g_signal_connect_after(text_view_, "expose-event",
@@ -1080,8 +1082,8 @@ void AutocompleteEditViewGtk::HandleViewMoveFocus(GtkWidget* widget) {
// Propagate the signal so that focus can be moved as normal.
}
-void AutocompleteEditViewGtk::HandleCopyClipboard() {
- // On copy, we manually update the PRIMARY selection to contain the
+void AutocompleteEditViewGtk::HandleCopyOrCutClipboard() {
+ // On copy or cut, we manually update the PRIMARY selection to contain the
// highlighted text. This matches Firefox -- we highlight the URL but don't
// update PRIMARY on Ctrl-L, so Ctrl-L, Ctrl-C and then middle-click is a
// convenient way to paste the current URL somewhere.
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
index 1d4918c..7923551 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
@@ -279,9 +279,14 @@ class AutocompleteEditViewGtk : public AutocompleteEditView,
void HandleViewMoveFocus(GtkWidget* widget);
static void HandleCopyClipboardThunk(GtkTextView* text_view, gpointer self) {
- reinterpret_cast<AutocompleteEditViewGtk*>(self)->HandleCopyClipboard();
+ reinterpret_cast<AutocompleteEditViewGtk*>(self)->
+ HandleCopyOrCutClipboard();
+ }
+ static void HandleCutClipboardThunk(GtkTextView* text_view, gpointer self) {
+ reinterpret_cast<AutocompleteEditViewGtk*>(self)->
+ HandleCopyOrCutClipboard();
}
- void HandleCopyClipboard();
+ void HandleCopyOrCutClipboard();
static void HandlePasteClipboardThunk(GtkTextView* text_view, gpointer self) {
reinterpret_cast<AutocompleteEditViewGtk*>(self)->HandlePasteClipboard();