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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void NativeTextfieldViews::UpdateFont() { | 390 void NativeTextfieldViews::UpdateFont() { |
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::UpdateIsObscured() { |
401 model_->set_is_password(textfield_->IsPassword()); | 401 model_->set_is_password(textfield_->IsObscured()); |
402 OnCaretBoundsChanged(); | 402 OnCaretBoundsChanged(); |
403 SchedulePaint(); | 403 SchedulePaint(); |
404 OnTextInputTypeChanged(); | 404 OnTextInputTypeChanged(); |
405 } | 405 } |
406 | 406 |
407 void NativeTextfieldViews::UpdateEnabled() { | 407 void NativeTextfieldViews::UpdateEnabled() { |
408 SetEnabled(textfield_->IsEnabled()); | 408 SetEnabled(textfield_->IsEnabled()); |
409 SchedulePaint(); | 409 SchedulePaint(); |
410 OnTextInputTypeChanged(); | 410 OnTextInputTypeChanged(); |
411 } | 411 } |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 | 1076 |
1077 #if defined(USE_AURA) | 1077 #if defined(USE_AURA) |
1078 // static | 1078 // static |
1079 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1079 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
1080 Textfield* field) { | 1080 Textfield* field) { |
1081 return new NativeTextfieldViews(field); | 1081 return new NativeTextfieldViews(field); |
1082 } | 1082 } |
1083 #endif | 1083 #endif |
1084 | 1084 |
1085 } // namespace views | 1085 } // namespace views |
OLD | NEW |