Chromium Code Reviews

Unified Diff: chrome/browser/gtk/find_bar_gtk.cc

Issue 5553002: Fix Find regression where text is not selected once you... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome/browser/gtk/find_bar_gtk.cc
===================================================================
--- chrome/browser/gtk/find_bar_gtk.cc (revision 68336)
+++ chrome/browser/gtk/find_bar_gtk.cc (working copy)
@@ -557,6 +557,17 @@
return UTF8ToUTF16(contents);
}
+string16 FindBarGtk::GetFindSelectedText() {
+ gint cursor_pos;
+ gint selection_bound;
+ g_object_get(G_OBJECT(text_entry_), "cursor-position", &cursor_pos,
+ NULL);
+ g_object_get(G_OBJECT(text_entry_), "selection-bound", &selection_bound,
+ NULL);
+ std::string contents(gtk_entry_get_text(GTK_ENTRY(text_entry_)));
+ return UTF8ToUTF16(contents.substr(cursor_pos, selection_bound));
+}
+
string16 FindBarGtk::GetMatchCountText() {
std::string contents(gtk_label_get_text(GTK_LABEL(match_count_label_)));
return UTF8ToUTF16(contents);

Powered by Google App Engine