summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 18:11:35 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 18:11:35 +0000
commit15a9c02836a9ce85c260c0827e6f3a037004ba2e (patch)
tree06690d317fa8bd14ea11b4fefdbf9e9fa13d7d7e /chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
parentca38d8e05b6cbd729487c6ed619117ae7510e4c6 (diff)
downloadchromium_src-15a9c02836a9ce85c260c0827e6f3a037004ba2e.zip
chromium_src-15a9c02836a9ce85c260c0827e6f3a037004ba2e.tar.gz
chromium_src-15a9c02836a9ce85c260c0827e6f3a037004ba2e.tar.bz2
Linux: Attempt #2 at updating PRIMARY selection on Ctrl-C in omnibox.
r23596 was the original attempt; r23714 reverted it. Using gtk_text_buffer_copy_clipboard() gives the GtkTextBuffer ownership of the GtkClipboard and appears to prevent it from unhighlighting its text. Tested as follows: 1. Select text in webkit and hit Ctrl-C; check that both the PRIMARY and CLIPBOARD selections contain it. 2. Click in the omnibox. All of the text gets highlighted. Check that the PRIMARY selection contains the omnibox text and the CLIPBOARD selection contains the webkit text. 3. Type Ctrl-C and confirm that the CLIPBOARD selection now contains the omnibox text. 4. Copy webkit text back to both selections. 5. Type Ctrl-L. The omnibox text gets highlighted but both selections still contain the webkit text. 6. Type Ctrl-C and confirm that both selections now contain the omnibox text. 7. Try hitting Ctrl-C again while the omnibox text is on the CLIPBOARD selection to make sure that a bizarre GTK crash doesn't occur (see comment in code). BUG=19648 TESTED=see above Review URL: http://codereview.chromium.org/173098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_edit_view_gtk.h')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
index 50293e3..b9c83a3 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
@@ -271,6 +271,11 @@ class AutocompleteEditViewGtk : public AutocompleteEditView,
}
void HandleBackSpace();
+ static void HandleCopyClipboardThunk(GtkTextView* text_view, gpointer self) {
+ reinterpret_cast<AutocompleteEditViewGtk*>(self)->HandleCopyClipboard();
+ }
+ void HandleCopyClipboard();
+
// Actual implementation of SelectAll(), but also provides control over
// whether the PRIMARY selection is set to the selected text (in SelectAll(),
// it isn't, but we want set the selection when the user clicks in the entry).