diff options
author | benrg@chromium.org <benrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 04:33:20 +0000 |
---|---|---|
committer | benrg@chromium.org <benrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 04:33:20 +0000 |
commit | 4bd6e19b07e43baa70da95d59a7bd6f47f5bf262 (patch) | |
tree | 13ad114e3d1c60ae1269f8afdf9bdf6c839058c6 /ui | |
parent | 22f58a413b507463f97804a947c732d9a1c7eec6 (diff) | |
download | chromium_src-4bd6e19b07e43baa70da95d59a7bd6f47f5bf262.zip chromium_src-4bd6e19b07e43baa70da95d59a7bd6f47f5bf262.tar.gz chromium_src-4bd6e19b07e43baa70da95d59a7bd6f47f5bf262.tar.bz2 |
Rename visual style "password" to "obscured"
This change renames some identifiers to distinguish the visual style of being drawn **** **** from the logical property of being a password. It is split off from issue 8748001 and issue 8747001. See http://codereview.chromium.org/8748001/#msg12 and http://codereview.chromium.org/8748001/#msg14 for discussion of the name.
TEXT_INPUT_TYPE_PASSWORD is unchanged; it should perhaps be renamed, but not to OBSCURED since it affects input, not display.
BUG=none
TEST=It compiles. Ship it.
Review URL: http://codereview.chromium.org/9117012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/controls/textfield/native_textfield_gtk.cc | 14 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_gtk.h | 6 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.cc | 8 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.h | 2 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views_unittest.cc | 18 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_win.cc | 16 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_win.h | 2 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_wrapper.h | 2 | ||||
-rw-r--r-- | ui/views/controls/textfield/textfield.cc | 26 | ||||
-rw-r--r-- | ui/views/controls/textfield/textfield.h | 15 | ||||
-rw-r--r-- | ui/views/controls/textfield/textfield_views_model.cc | 4 | ||||
-rw-r--r-- | ui/views/controls/textfield/textfield_views_model.h | 10 | ||||
-rw-r--r-- | ui/views/controls/textfield/textfield_views_model_unittest.cc | 4 | ||||
-rw-r--r-- | ui/views/examples/textfield_example.cc | 4 | ||||
-rw-r--r-- | ui/views/view_unittest.cc | 4 |
15 files changed, 68 insertions, 67 deletions
diff --git a/ui/views/controls/textfield/native_textfield_gtk.cc b/ui/views/controls/textfield/native_textfield_gtk.cc index 0316568..79d416b 100644 --- a/ui/views/controls/textfield/native_textfield_gtk.cc +++ b/ui/views/controls/textfield/native_textfield_gtk.cc @@ -23,8 +23,8 @@ namespace views { -// A character used to hide a text in password mode. -static const char kPasswordChar = '*'; +// A character used to hide a text in obscured mode. +static const char kObscuredChar = '*'; // Border width for GtkTextView. const int kTextViewBorderWidth = 4; @@ -166,10 +166,10 @@ void NativeTextfieldGtk::UpdateFont() { pango_font_description_free(pfd); } -void NativeTextfieldGtk::UpdateIsPassword() { +void NativeTextfieldGtk::UpdateIsObscured() { if (!native_view()) return; - gtk_entry_set_visibility(GTK_ENTRY(native_view()), !textfield_->IsPassword()); + gtk_entry_set_visibility(GTK_ENTRY(native_view()), !textfield_->IsObscured()); } void NativeTextfieldGtk::UpdateEnabled() { @@ -399,7 +399,7 @@ void NativeTextfieldGtk::OnPasteClipboard(GtkWidget* widget) { void NativeTextfieldGtk::CreateNativeControl() { NativeControlCreated(gtk_views_entry_new(this)); gtk_entry_set_invisible_char(GTK_ENTRY(native_view()), - static_cast<gunichar>(kPasswordChar)); + static_cast<gunichar>(kObscuredChar)); textfield_->UpdateAllProperties(); } @@ -424,8 +424,8 @@ void NativeTextfieldGtk::NativeControlCreated(GtkWidget* widget) { G_CALLBACK(OnKeyPressEventAfterThunk), this); } -bool NativeTextfieldGtk::IsPassword() { - return textfield_->IsPassword(); +bool NativeTextfieldGtk::IsObscured() { + return textfield_->IsObscured(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/views/controls/textfield/native_textfield_gtk.h b/ui/views/controls/textfield/native_textfield_gtk.h index 0b4ae89..cc773a1 100644 --- a/ui/views/controls/textfield/native_textfield_gtk.h +++ b/ui/views/controls/textfield/native_textfield_gtk.h @@ -44,7 +44,7 @@ class NativeTextfieldGtk : public NativeControlGtk, virtual void UpdateBackgroundColor() OVERRIDE; virtual void UpdateReadOnly() OVERRIDE; virtual void UpdateFont() OVERRIDE; - virtual void UpdateIsPassword() OVERRIDE; + virtual void UpdateIsObscured() OVERRIDE; virtual void UpdateEnabled() OVERRIDE; virtual gfx::Insets CalculateInsets() OVERRIDE; virtual void UpdateHorizontalMargins() OVERRIDE; @@ -72,8 +72,8 @@ class NativeTextfieldGtk : public NativeControlGtk, virtual void CreateNativeControl() OVERRIDE; virtual void NativeControlCreated(GtkWidget* widget) OVERRIDE; - // Returns true if the textfield is for password. - bool IsPassword(); + // Returns true if the textfield is obscured (shown as *****). + bool IsObscured(); private: // Gtk signal callbacks. diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc index 5f2ac4f..3d162e1 100644 --- a/ui/views/controls/textfield/native_textfield_views.cc +++ b/ui/views/controls/textfield/native_textfield_views.cc @@ -408,8 +408,8 @@ void NativeTextfieldViews::UpdateFont() { #endif } -void NativeTextfieldViews::UpdateIsPassword() { - model_->set_is_password(textfield_->IsPassword()); +void NativeTextfieldViews::UpdateIsObscured() { + model_->set_is_obscured(textfield_->IsObscured()); OnCaretBoundsChanged(); SchedulePaint(); OnTextInputTypeChanged(); @@ -715,8 +715,8 @@ bool NativeTextfieldViews::HasCompositionText() { } bool NativeTextfieldViews::GetTextRange(ui::Range* range) { - // We don't allow the input method to retrieve or delete content from a - // password box. + // We don't allow the input method to retrieve or delete content from an + // obscured textfield. if (GetTextInputType() != ui::TEXT_INPUT_TYPE_TEXT) return false; diff --git a/ui/views/controls/textfield/native_textfield_views.h b/ui/views/controls/textfield/native_textfield_views.h index 73d4b3a..3aa5621 100644 --- a/ui/views/controls/textfield/native_textfield_views.h +++ b/ui/views/controls/textfield/native_textfield_views.h @@ -101,7 +101,7 @@ class VIEWS_EXPORT NativeTextfieldViews : public TouchSelectionClientView, virtual void UpdateBackgroundColor() OVERRIDE; virtual void UpdateReadOnly() OVERRIDE; virtual void UpdateFont() OVERRIDE; - virtual void UpdateIsPassword() OVERRIDE; + virtual void UpdateIsObscured() OVERRIDE; virtual void UpdateEnabled() OVERRIDE; virtual gfx::Insets CalculateInsets() OVERRIDE; virtual void UpdateHorizontalMargins() OVERRIDE; diff --git a/ui/views/controls/textfield/native_textfield_views_unittest.cc b/ui/views/controls/textfield/native_textfield_views_unittest.cc index 7b654d2..5710156 100644 --- a/ui/views/controls/textfield/native_textfield_views_unittest.cc +++ b/ui/views/controls/textfield/native_textfield_views_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -499,7 +499,7 @@ TEST_F(NativeTextfieldViewsTest, InsertionDeletionTest) { } TEST_F(NativeTextfieldViewsTest, PasswordTest) { - InitTextfield(Textfield::STYLE_PASSWORD); + InitTextfield(Textfield::STYLE_OBSCURED); EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, GetTextInputType()); @@ -511,28 +511,28 @@ TEST_F(NativeTextfieldViewsTest, PasswordTest) { EXPECT_TRUE(last_contents_.empty()); } -TEST_F(NativeTextfieldViewsTest, InputTypeSetsPassword) { +TEST_F(NativeTextfieldViewsTest, InputTypeSetsObscured) { InitTextfield(Textfield::STYLE_DEFAULT); // Defaults to TEXT EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, GetTextInputType()); - // Setting to passwords also sets password state of textfield. + // Setting to TEXT_INPUT_TYPE_PASSWORD also sets obscured state of textfield. textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, GetTextInputType()); - EXPECT_TRUE(textfield_->IsPassword()); + EXPECT_TRUE(textfield_->IsObscured()); } -TEST_F(NativeTextfieldViewsTest, PasswordSetsInputType) { +TEST_F(NativeTextfieldViewsTest, ObscuredSetsInputType) { InitTextfield(Textfield::STYLE_DEFAULT); // Defaults to TEXT EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, GetTextInputType()); - textfield_->SetPassword(true); + textfield_->SetObscured(true); EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, GetTextInputType()); - textfield_->SetPassword(false); + textfield_->SetObscured(false); EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, GetTextInputType()); } @@ -1114,7 +1114,7 @@ TEST_F(NativeTextfieldViewsTest, TextInputClientTest) { textfield_->SetReadOnly(false); input_method_->Clear(); - textfield_->SetPassword(true); + textfield_->SetObscured(true); EXPECT_TRUE(input_method_->text_input_type_changed()); EXPECT_TRUE(textfield_->GetTextInputClient()); } diff --git a/ui/views/controls/textfield/native_textfield_win.cc b/ui/views/controls/textfield/native_textfield_win.cc index 2d43608..5257259 100644 --- a/ui/views/controls/textfield/native_textfield_win.cc +++ b/ui/views/controls/textfield/native_textfield_win.cc @@ -100,7 +100,7 @@ NativeTextfieldWin::NativeTextfieldWin(Textfield* textfield) did_load_library_ = !!LoadLibrary(L"riched20.dll"); DWORD style = kDefaultEditStyle | ES_AUTOHSCROLL; - if (textfield_->style() & Textfield::STYLE_PASSWORD) + if (textfield_->style() & Textfield::STYLE_OBSCURED) style |= ES_PASSWORD; if (textfield_->read_only()) @@ -113,7 +113,7 @@ NativeTextfieldWin::NativeTextfieldWin(Textfield* textfield) Create(textfield_->GetWidget()->GetNativeView(), r, NULL, style, ex_style); if (textfield_->style() & Textfield::STYLE_LOWERCASE) { - DCHECK((textfield_->style() & Textfield::STYLE_PASSWORD) == 0); + DCHECK((textfield_->style() & Textfield::STYLE_OBSCURED) == 0); SetEditStyle(SES_LOWERCASE, SES_LOWERCASE); } @@ -260,9 +260,9 @@ void NativeTextfieldWin::UpdateFont() { UpdateTextColor(); } -void NativeTextfieldWin::UpdateIsPassword() { +void NativeTextfieldWin::UpdateIsObscured() { // TODO: Need to implement for Windows. - UpdateAccessibleState(STATE_SYSTEM_PROTECTED, textfield_->IsPassword()); + UpdateAccessibleState(STATE_SYSTEM_PROTECTED, textfield_->IsObscured()); } void NativeTextfieldWin::UpdateEnabled() { @@ -399,8 +399,8 @@ bool NativeTextfieldWin::IsCommandIdEnabled(int command_id) const { switch (command_id) { case IDS_APP_UNDO: return !textfield_->read_only() && !!CanUndo(); case IDS_APP_CUT: return !textfield_->read_only() && - !textfield_->IsPassword() && !!CanCut(); - case IDS_APP_COPY: return !!CanCopy() && !textfield_->IsPassword(); + !textfield_->IsObscured() && !!CanCut(); + case IDS_APP_COPY: return !!CanCopy() && !textfield_->IsObscured(); case IDS_APP_PASTE: return !textfield_->read_only() && !!CanPaste(); case IDS_APP_SELECT_ALL: return !!CanSelectAll(); default: NOTREACHED(); @@ -526,7 +526,7 @@ void NativeTextfieldWin::OnContextMenu(HWND window, const POINT& point) { } void NativeTextfieldWin::OnCopy() { - if (textfield_->IsPassword()) + if (textfield_->IsObscured()) return; const string16 text(GetSelectedText()); @@ -538,7 +538,7 @@ void NativeTextfieldWin::OnCopy() { } void NativeTextfieldWin::OnCut() { - if (textfield_->read_only() || textfield_->IsPassword()) + if (textfield_->read_only() || textfield_->IsObscured()) return; OnCopy(); diff --git a/ui/views/controls/textfield/native_textfield_win.h b/ui/views/controls/textfield/native_textfield_win.h index 9d1ec0e..5b9001b 100644 --- a/ui/views/controls/textfield/native_textfield_win.h +++ b/ui/views/controls/textfield/native_textfield_win.h @@ -74,7 +74,7 @@ class NativeTextfieldWin virtual void UpdateBackgroundColor() OVERRIDE; virtual void UpdateReadOnly() OVERRIDE; virtual void UpdateFont() OVERRIDE; - virtual void UpdateIsPassword() OVERRIDE; + virtual void UpdateIsObscured() OVERRIDE; virtual void UpdateEnabled() OVERRIDE; virtual gfx::Insets CalculateInsets() OVERRIDE; virtual void UpdateHorizontalMargins() OVERRIDE; diff --git a/ui/views/controls/textfield/native_textfield_wrapper.h b/ui/views/controls/textfield/native_textfield_wrapper.h index d619aef..ef8e8be 100644 --- a/ui/views/controls/textfield/native_textfield_wrapper.h +++ b/ui/views/controls/textfield/native_textfield_wrapper.h @@ -72,7 +72,7 @@ class VIEWS_EXPORT NativeTextfieldWrapper { virtual void UpdateFont() = 0; // Updates the visibility of the text in the native text field. - virtual void UpdateIsPassword() = 0; + virtual void UpdateIsObscured() = 0; // Updates the enabled state of the native text field. virtual void UpdateEnabled() = 0; diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index 185a116..6da0510 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_; diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h index b976354..6c62fa7 100644 --- a/ui/views/controls/textfield/textfield.h +++ b/ui/views/controls/textfield/textfield.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -47,7 +47,7 @@ class VIEWS_EXPORT Textfield : public View { enum StyleFlags { STYLE_DEFAULT = 0, - STYLE_PASSWORD = 1 << 0, + STYLE_OBSCURED = 1 << 0, STYLE_LOWERCASE = 1 << 1 }; @@ -63,12 +63,13 @@ class VIEWS_EXPORT Textfield : public View { bool read_only() const { return read_only_; } void SetReadOnly(bool read_only); - // Gets/Sets whether or not this Textfield is a password field. - // TODO(bryeung): Currently this is only used in + // Gets/sets the STYLE_OBSCURED bit, controlling whether characters in this + // Textfield are displayed as asterisks/bullets. + // TODO(bryeung): Currently SetObscured is only used in // chrome/browser/chromeos/options/wifi_config_view.cc, which is being - // converted to WebUI. Please remove this when that happens. - bool IsPassword() const; - void SetPassword(bool password); + // converted to WebUI. Please remove it when that happens. + bool IsObscured() const; + void SetObscured(bool obscured); // Gets/Sets the input type of this textfield. ui::TextInputType GetTextInputType() const; diff --git a/ui/views/controls/textfield/textfield_views_model.cc b/ui/views/controls/textfield/textfield_views_model.cc index ab5a94b..f530c5a 100644 --- a/ui/views/controls/textfield/textfield_views_model.cc +++ b/ui/views/controls/textfield/textfield_views_model.cc @@ -281,7 +281,7 @@ TextfieldViewsModel::Delegate::~Delegate() { TextfieldViewsModel::TextfieldViewsModel(Delegate* delegate) : delegate_(delegate), render_text_(gfx::RenderText::CreateRenderText()), - is_password_(false), + is_obscured_(false), current_edit_(edit_history_.end()) { } @@ -640,7 +640,7 @@ bool TextfieldViewsModel::HasCompositionText() const { string16 TextfieldViewsModel::GetVisibleText(size_t begin, size_t end) const { DCHECK(end >= begin); - if (is_password_) + if (is_obscured_) return string16(end - begin, '*'); return GetText().substr(begin, end - begin); } diff --git a/ui/views/controls/textfield/textfield_views_model.h b/ui/views/controls/textfield/textfield_views_model.h index 51a4ea4..7aceb66 100644 --- a/ui/views/controls/textfield/textfield_views_model.h +++ b/ui/views/controls/textfield/textfield_views_model.h @@ -65,8 +65,8 @@ class VIEWS_EXPORT TextfieldViewsModel { explicit TextfieldViewsModel(Delegate* delegate); virtual ~TextfieldViewsModel(); - void set_is_password(bool is_password) { - is_password_ = is_password; + void set_is_obscured(bool is_obscured) { + is_obscured_ = is_obscured; } // Edit related methods. @@ -183,7 +183,7 @@ class VIEWS_EXPORT TextfieldViewsModel { // Redo edit. Returns true if redo changed the text. bool Redo(); - // Returns visible text. If the field is password, it returns the + // Returns visible text. If the field is obscured, it returns the // sequence of "*". string16 GetVisibleText() const; @@ -304,8 +304,8 @@ class VIEWS_EXPORT TextfieldViewsModel { // The stylized text, cursor, selection, and the visual layout model. scoped_ptr<gfx::RenderText> render_text_; - // True if the text is the password. - bool is_password_; + // True if the text is obscured (e.g., a password). + bool is_obscured_; typedef std::list<internal::Edit*> EditHistory; EditHistory edit_history_; diff --git a/ui/views/controls/textfield/textfield_views_model_unittest.cc b/ui/views/controls/textfield/textfield_views_model_unittest.cc index 39a1375b..c499fe8 100644 --- a/ui/views/controls/textfield/textfield_views_model_unittest.cc +++ b/ui/views/controls/textfield/textfield_views_model_unittest.cc @@ -419,9 +419,9 @@ TEST_F(TextfieldViewsModelTest, SelectionAndEdit) { EXPECT_STR_EQ("BEE", model.GetText()); } -TEST_F(TextfieldViewsModelTest, Password) { +TEST_F(TextfieldViewsModelTest, Obscured) { TextfieldViewsModel model(NULL); - model.set_is_password(true); + model.set_is_obscured(true); model.Append(ASCIIToUTF16("HELLO")); EXPECT_STR_EQ("*****", model.GetVisibleText()); EXPECT_STR_EQ("HELLO", model.GetText()); diff --git a/ui/views/examples/textfield_example.cc b/ui/views/examples/textfield_example.cc index 7b4986c..e018581 100644 --- a/ui/views/examples/textfield_example.cc +++ b/ui/views/examples/textfield_example.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -23,7 +23,7 @@ TextfieldExample::~TextfieldExample() { void TextfieldExample::CreateExampleView(View* container) { name_ = new Textfield(); - password_ = new Textfield(Textfield::STYLE_PASSWORD); + password_ = new Textfield(Textfield::STYLE_OBSCURED); password_->set_text_to_display_when_empty(ASCIIToUTF16("password")); show_password_ = new TextButton(this, ASCIIToUTF16("Show password")); clear_all_ = new TextButton(this, ASCIIToUTF16("Clear All")); diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index 45e7dbd..79ef2fd 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc @@ -897,7 +897,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { Textfield* normal = new Textfield(); Textfield* read_only = new Textfield(); read_only->SetReadOnly(true); - Textfield* password = new Textfield(Textfield::STYLE_PASSWORD); + Textfield* password = new Textfield(Textfield::STYLE_OBSCURED); root_view->AddChildView(normal); root_view->AddChildView(read_only); @@ -957,7 +957,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { ::SendMessage(password->GetTestingHandle(), WM_COPY, 0, 0); result.clear(); clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &result); - // We don't let you copy from a password field, clipboard should not have + // We don't let you copy from an obscured field, clipboard should not have // changed. EXPECT_EQ(kNormalText, result); |