summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/textfield/textfield.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/views/controls/textfield/textfield.cc')
-rw-r--r--ui/views/controls/textfield/textfield.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index ffbabe0..e2beb4d 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -92,6 +92,7 @@ TextfieldController* Textfield::GetController() const {
void Textfield::SetReadOnly(bool read_only) {
read_only_ = read_only;
+ set_focusable(!read_only);
if (native_wrapper_) {
native_wrapper_->UpdateReadOnly();
native_wrapper_->UpdateTextColor();
@@ -330,10 +331,6 @@ gfx::Size Textfield::GetPreferredSize() {
insets.width(), font_.GetHeight() + insets.height());
}
-bool Textfield::IsFocusable() const {
- return View::IsFocusable() && !read_only_;
-}
-
void Textfield::AboutToRequestFocusFromTabTraversal(bool reverse) {
SelectAll();
}