OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 void Textfield::SetController(TextfieldController* controller) { | 122 void Textfield::SetController(TextfieldController* controller) { |
123 controller_ = controller; | 123 controller_ = controller; |
124 } | 124 } |
125 | 125 |
126 TextfieldController* Textfield::GetController() const { | 126 TextfieldController* Textfield::GetController() const { |
127 return controller_; | 127 return controller_; |
128 } | 128 } |
129 | 129 |
130 void Textfield::SetReadOnly(bool read_only) { | 130 void Textfield::SetReadOnly(bool read_only) { |
131 read_only_ = read_only; | 131 read_only_ = read_only; |
132 set_focusable(!read_only); | |
oshima
2013/05/23 17:52:58
can you add comment not to change focusable so tha
msw
2013/05/23 19:08:13
Done.
| |
133 if (native_wrapper_) { | 132 if (native_wrapper_) { |
134 native_wrapper_->UpdateReadOnly(); | 133 native_wrapper_->UpdateReadOnly(); |
135 native_wrapper_->UpdateTextColor(); | 134 native_wrapper_->UpdateTextColor(); |
136 native_wrapper_->UpdateBackgroundColor(); | 135 native_wrapper_->UpdateBackgroundColor(); |
137 } | 136 } |
138 } | 137 } |
139 | 138 |
140 bool Textfield::IsObscured() const { | 139 bool Textfield::IsObscured() const { |
141 return style_ & STYLE_OBSCURED; | 140 return style_ & STYLE_OBSCURED; |
142 } | 141 } |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 600 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
602 Textfield* field) { | 601 Textfield* field) { |
603 #if defined(OS_WIN) && !defined(USE_AURA) | 602 #if defined(OS_WIN) && !defined(USE_AURA) |
604 if (!Textfield::IsViewsTextfieldEnabled()) | 603 if (!Textfield::IsViewsTextfieldEnabled()) |
605 return new NativeTextfieldWin(field); | 604 return new NativeTextfieldWin(field); |
606 #endif | 605 #endif |
607 return new NativeTextfieldViews(field); | 606 return new NativeTextfieldViews(field); |
608 } | 607 } |
609 | 608 |
610 } // namespace views | 609 } // namespace views |
OLD | NEW |