summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 21:14:46 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 21:14:46 +0000
commitc9e7188043ecef0b0c50c4cb7f978ad0da56539e (patch)
tree80e6f7017efb7a8723c333301218b316b499d125
parent7db5d174005149773ff076266eb28dfe7d9065c3 (diff)
downloadchromium_src-c9e7188043ecef0b0c50c4cb7f978ad0da56539e.zip
chromium_src-c9e7188043ecef0b0c50c4cb7f978ad0da56539e.tar.gz
chromium_src-c9e7188043ecef0b0c50c4cb7f978ad0da56539e.tar.bz2
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
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc7
1 files 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) {