Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.h

Issue 159185: Linux: Prevent omnibox autocomplete from stealing the primary X selection. (Closed)
Patch Set: update primary selection on focusing click in omnibox Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
index 97708d046c9d66d2cb93f53bd860591a164a4ee9..e0370eef9591c5aa5fe69b3e6197fe2d9b3da4b3 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h
@@ -212,6 +212,21 @@ class AutocompleteEditViewGtk : public AutocompleteEditView {
GtkTextIter* location,
GtkTextMark* mark);
+ // 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).
+ void SelectAllInternal(bool reversed, bool update_primary_selection);
+
+ // Get ready to update |text_buffer_|'s highlighting without making changes to
+ // the PRIMARY selection. Removes the clipboard from |text_buffer_| and
+ // blocks the "mark-set" signal handler.
+ void StartUpdatingHighlightedText();
+
+ // Finish updating |text_buffer_|'s highlighting such that future changes will
+ // automatically update the PRIMARY selection. Undoes
+ // StartUpdatingHighlightedText()'s changes.
+ void FinishUpdatingHighlightedText();
+
// Get the character indices of the current selection. This honors
// direction, cp_max is the insertion point, and cp_min is the bound.
CharRange GetSelection();
@@ -230,7 +245,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView {
// Internally invoked whenever the text changes in some way.
void TextChanged();
- // Save 'selected_text' as the PRIMARY X selection.
+ // Save |selected_text| as the PRIMARY X selection.
void SavePrimarySelection(const std::string& selected_text);
// The widget we expose, used for vertically centering the real text edit,
@@ -274,10 +289,13 @@ class AutocompleteEditViewGtk : public AutocompleteEditView {
// it, we pass this string to SavePrimarySelection()).
std::string selected_text_;
- // Has the current value of 'selected_text_' been saved as the PRIMARY
+ // Has the current value of |selected_text_| been saved as the PRIMARY
// selection?
bool selection_saved_;
+ // ID of the signal handler for "mark-set" on |text_buffer_|.
+ gulong mark_set_handler_id_;
+
DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk);
};
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698