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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 8909002: views: Convert IsEnabled() to just enabled() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/textfield/native_textfield_win.cc ('k') | ui/views/view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #endif 9 #endif
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } else { 110 } else {
111 style_ = static_cast<StyleFlags>(style_ & ~STYLE_PASSWORD); 111 style_ = static_cast<StyleFlags>(style_ & ~STYLE_PASSWORD);
112 SetTextInputType(ui::TEXT_INPUT_TYPE_TEXT); 112 SetTextInputType(ui::TEXT_INPUT_TYPE_TEXT);
113 } 113 }
114 if (native_wrapper_) 114 if (native_wrapper_)
115 native_wrapper_->UpdateIsPassword(); 115 native_wrapper_->UpdateIsPassword();
116 } 116 }
117 117
118 118
119 ui::TextInputType Textfield::GetTextInputType() const { 119 ui::TextInputType Textfield::GetTextInputType() const {
120 if (read_only() || !IsEnabled()) 120 if (read_only() || !enabled())
121 return ui::TEXT_INPUT_TYPE_NONE; 121 return ui::TEXT_INPUT_TYPE_NONE;
122 return text_input_type_; 122 return text_input_type_;
123 } 123 }
124 124
125 void Textfield::SetTextInputType(ui::TextInputType type) { 125 void Textfield::SetTextInputType(ui::TextInputType type) {
126 text_input_type_ = type; 126 text_input_type_ = type;
127 bool should_be_password = type == ui::TEXT_INPUT_TYPE_PASSWORD; 127 bool should_be_password = type == ui::TEXT_INPUT_TYPE_PASSWORD;
128 if (IsPassword() != should_be_password) 128 if (IsPassword() != should_be_password)
129 SetPassword(should_be_password); 129 SetPassword(should_be_password);
130 } 130 }
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 444 }
445 #endif 445 #endif
446 } 446 }
447 } 447 }
448 448
449 std::string Textfield::GetClassName() const { 449 std::string Textfield::GetClassName() const {
450 return kViewClassName; 450 return kViewClassName;
451 } 451 }
452 452
453 } // namespace views 453 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_win.cc ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698