Index: ui/views/controls/textfield/textfield.cc |
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc |
index 6da051073be25960449c556782802ba0a5b8f17e..7cdddc658849d6798690cb1e9fd3303c727892c0 100644 |
--- a/ui/views/controls/textfield/textfield.cc |
+++ b/ui/views/controls/textfield/textfield.cc |
@@ -105,18 +105,13 @@ bool Textfield::IsObscured() const { |
} |
void Textfield::SetObscured(bool obscured) { |
- if (obscured) { |
- style_ = static_cast<StyleFlags>(style_ | STYLE_OBSCURED); |
- SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); |
- } else { |
- style_ = static_cast<StyleFlags>(style_ & ~STYLE_OBSCURED); |
- SetTextInputType(ui::TEXT_INPUT_TYPE_TEXT); |
+ if (obscured != IsObscured()) { |
+ style_ = static_cast<StyleFlags>(style_ ^ STYLE_OBSCURED); |
+ if (native_wrapper_) |
+ native_wrapper_->UpdateIsObscured(); |
} |
- if (native_wrapper_) |
- native_wrapper_->UpdateIsObscured(); |
} |
- |
ui::TextInputType Textfield::GetTextInputType() const { |
if (read_only() || !enabled()) |
return ui::TEXT_INPUT_TYPE_NONE; |
@@ -125,9 +120,6 @@ ui::TextInputType Textfield::GetTextInputType() const { |
void Textfield::SetTextInputType(ui::TextInputType type) { |
text_input_type_ = type; |
- bool should_be_obscured = type == ui::TEXT_INPUT_TYPE_PASSWORD; |
- if (IsObscured() != should_be_obscured) |
- SetObscured(should_be_obscured); |
} |
void Textfield::SetText(const string16& text) { |