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

Unified Diff: chrome/browser/ui/views/find_bar_view.h

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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/find_bar_view.h
===================================================================
--- chrome/browser/ui/views/find_bar_view.h (revision 68336)
+++ chrome/browser/ui/views/find_bar_view.h (working copy)
@@ -47,6 +47,9 @@
string16 GetFindText() const;
void SetFindText(const string16& find_text);
+ // Gets the selected text in the text box.
+ string16 GetFindSelectedText() const;
+
// Gets the match count text displayed in the text box.
string16 GetMatchCountText() const;
@@ -105,12 +108,25 @@
DISALLOW_COPY_AND_ASSIGN(FocusForwarderView);
};
+ // A wrapper of views::TextField that allows us to select all text when we
+ // get focus. Represents the text field where the user enters a search term.
+ class SearchTextfieldView : public views::Textfield {
Jay Civelli 2010/12/06 22:14:09 May be that could have been added as a property of
+ public:
+ SearchTextfieldView();
+ virtual ~SearchTextfieldView();
+
+ virtual void RequestFocus();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SearchTextfieldView);
+ };
+
// Returns the OS-specific view for the find bar that acts as an intermediary
// between us and the TabContentsView.
FindBarHost* find_bar_host() const;
#if defined(OS_LINUX)
- // In gtk we get changed signals if we programatically set the text. If we
+ // In GTK we get changed signals if we programmatically set the text. If we
// don't ignore them we run into problems. For example, switching tabs back
// to one with the find bar visible will cause a search to the next found
// text. Also if the find bar had been visible and then hidden and the user
@@ -119,7 +135,7 @@
#endif
// The controls in the window.
- views::Textfield* find_text_;
+ SearchTextfieldView* find_text_;
views::Label* match_count_text_;
FocusForwarderView* focus_forwarder_view_;
views::ImageButton* find_previous_button_;
« no previous file with comments | « chrome/browser/ui/views/find_bar_host_interactive_uitest.cc ('k') | chrome/browser/ui/views/find_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698