| 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/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // Update the default text style. | 391 // Update the default text style. |
| 392 gfx::StyleRange default_style(GetRenderText()->default_style()); | 392 gfx::StyleRange default_style(GetRenderText()->default_style()); |
| 393 default_style.font = textfield_->font(); | 393 default_style.font = textfield_->font(); |
| 394 GetRenderText()->set_default_style(default_style); | 394 GetRenderText()->set_default_style(default_style); |
| 395 GetRenderText()->ApplyDefaultStyle(); | 395 GetRenderText()->ApplyDefaultStyle(); |
| 396 | 396 |
| 397 OnCaretBoundsChanged(); | 397 OnCaretBoundsChanged(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void NativeTextfieldViews::UpdateIsPassword() { | 400 void NativeTextfieldViews::UpdateIsPassword() { |
| 401 model_->set_is_password(textfield_->IsPassword()); | 401 gfx::StyleRange default_style(GetRenderText()->default_style()); |
| 402 default_style.password = textfield_->IsPassword(); |
| 403 GetRenderText()->set_default_style(default_style); |
| 404 GetRenderText()->ApplyDefaultStyle(); |
| 405 |
| 402 OnCaretBoundsChanged(); | 406 OnCaretBoundsChanged(); |
| 403 SchedulePaint(); | 407 SchedulePaint(); |
| 404 OnTextInputTypeChanged(); | 408 OnTextInputTypeChanged(); |
| 405 } | 409 } |
| 406 | 410 |
| 407 void NativeTextfieldViews::UpdateEnabled() { | 411 void NativeTextfieldViews::UpdateEnabled() { |
| 408 SetEnabled(textfield_->IsEnabled()); | 412 SetEnabled(textfield_->IsEnabled()); |
| 409 SchedulePaint(); | 413 SchedulePaint(); |
| 410 OnTextInputTypeChanged(); | 414 OnTextInputTypeChanged(); |
| 411 } | 415 } |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 | 1080 |
| 1077 #if defined(USE_AURA) | 1081 #if defined(USE_AURA) |
| 1078 // static | 1082 // static |
| 1079 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1083 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 1080 Textfield* field) { | 1084 Textfield* field) { |
| 1081 return new NativeTextfieldViews(field); | 1085 return new NativeTextfieldViews(field); |
| 1082 } | 1086 } |
| 1083 #endif | 1087 #endif |
| 1084 | 1088 |
| 1085 } // namespace views | 1089 } // namespace views |
| OLD | NEW |