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

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

Issue 9117012: Rename visual style "password" to "obscured" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 8 years, 11 months 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 | « ui/views/controls/textfield/textfield.h ('k') | ui/views/controls/textfield/textfield_views_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 185a11651a5a618632ff9dfe4597166ac2c45506..6da051073be25960449c556782802ba0a5b8f17e 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -75,7 +75,7 @@ Textfield::Textfield(StyleFlags style)
vertical_margins_were_set_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_TEXT) {
set_focusable(true);
- if (IsPassword())
+ if (IsObscured())
SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
}
@@ -100,20 +100,20 @@ void Textfield::SetReadOnly(bool read_only) {
}
}
-bool Textfield::IsPassword() const {
- return style_ & STYLE_PASSWORD;
+bool Textfield::IsObscured() const {
+ return style_ & STYLE_OBSCURED;
}
-void Textfield::SetPassword(bool password) {
- if (password) {
- style_ = static_cast<StyleFlags>(style_ | STYLE_PASSWORD);
+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_PASSWORD);
+ style_ = static_cast<StyleFlags>(style_ & ~STYLE_OBSCURED);
SetTextInputType(ui::TEXT_INPUT_TYPE_TEXT);
}
if (native_wrapper_)
- native_wrapper_->UpdateIsPassword();
+ native_wrapper_->UpdateIsObscured();
}
@@ -125,9 +125,9 @@ ui::TextInputType Textfield::GetTextInputType() const {
void Textfield::SetTextInputType(ui::TextInputType type) {
text_input_type_ = type;
- bool should_be_password = type == ui::TEXT_INPUT_TYPE_PASSWORD;
- if (IsPassword() != should_be_password)
- SetPassword(should_be_password);
+ 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) {
@@ -248,7 +248,7 @@ void Textfield::UpdateAllProperties() {
native_wrapper_->UpdateFont();
native_wrapper_->UpdateEnabled();
native_wrapper_->UpdateBorder();
- native_wrapper_->UpdateIsPassword();
+ native_wrapper_->UpdateIsObscured();
native_wrapper_->UpdateHorizontalMargins();
native_wrapper_->UpdateVerticalMargins();
}
@@ -403,7 +403,7 @@ void Textfield::GetAccessibleState(ui::AccessibleViewState* state) {
state->name = accessible_name_;
if (read_only())
state->state |= ui::AccessibilityTypes::STATE_READONLY;
- if (IsPassword())
+ if (IsObscured())
state->state |= ui::AccessibilityTypes::STATE_PROTECTED;
state->value = text_;
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/controls/textfield/textfield_views_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698