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

Unified Diff: views/controls/textfield/textfield.cc

Issue 8368016: Rebase BookmarkBubble on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Anchor by View instead of Point, tweak select_on_focus, add TextfieldTest. Created 9 years, 1 month 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 | « views/controls/textfield/textfield.h ('k') | views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/textfield.cc
diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc
index 8eaa0deedaab6dd1f5692d2d768af0037ab98441..8086d0d60bb617bff7d0304dd7937af9161cb1ab 100644
--- a/views/controls/textfield/textfield.cc
+++ b/views/controls/textfield/textfield.cc
@@ -55,6 +55,7 @@ Textfield::Textfield()
initialized_(false),
horizontal_margins_were_set_(false),
vertical_margins_were_set_(false),
+ select_all_on_focus_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_TEXT) {
set_focusable(true);
}
@@ -73,6 +74,7 @@ Textfield::Textfield(StyleFlags style)
initialized_(false),
horizontal_margins_were_set_(false),
vertical_margins_were_set_(false),
+ select_all_on_focus_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_TEXT) {
set_focusable(true);
if (IsPassword())
@@ -387,6 +389,11 @@ void Textfield::OnFocus() {
// keyboard messages.
View::OnFocus();
}
+
+ if (select_all_on_focus())
+ SelectAll();
+ else
+ ClearSelection();
jennyz 2011/11/10 18:08:33 I still concern this may affect the NativeTextfiel
jennyz 2011/11/10 18:27:06 Sorry I missed some detail in previous comment. I
}
void Textfield::OnBlur() {
« no previous file with comments | « views/controls/textfield/textfield.h ('k') | views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698