| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |