From c9e7188043ecef0b0c50c4cb7f978ad0da56539e Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Thu, 20 May 2010 21:14:46 +0000 Subject: GTK: delete text when cutting from the omnibox. BUG=44232 TEST=cut all the contents from the omnibox. The url (along with the protocol) should be on both PRIMARY and CLIPBOARD selections. The omnibox should now lay empty. Review URL: http://codereview.chromium.org/2108014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47847 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 7977253..21f964f 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -1215,8 +1215,6 @@ void AutocompleteEditViewGtk::HandleCopyOrCutClipboard(bool copy) { model_->AdjustTextForCopy(selection.selection_min(), IsSelectAll(), &text, &url, &write_url); - OwnPrimarySelection(WideToUTF8(text)); - if (write_url) { ScopedClipboardWriter scw(g_browser_process->clipboard()); string16 text16(WideToUTF16(text)); @@ -1233,7 +1231,12 @@ void AutocompleteEditViewGtk::HandleCopyOrCutClipboard(bool copy) { g_signal_stop_emission(text_view_, copy ? copy_signal_id : cut_signal_id, 0); + + if (!copy) + gtk_text_buffer_delete_selection(text_buffer_, true, true); } + + OwnPrimarySelection(WideToUTF8(text)); } void AutocompleteEditViewGtk::OwnPrimarySelection(const std::string& text) { -- cgit v1.1