| 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 "views/controls/textfield/native_textfield_views.h" | 5 #include "views/controls/textfield/native_textfield_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 skip_input_method_cancel_composition_ = false; | 697 skip_input_method_cancel_composition_ = false; |
| 698 UpdateAfterChange(true, true); | 698 UpdateAfterChange(true, true); |
| 699 OnAfterUserAction(); | 699 OnAfterUserAction(); |
| 700 } | 700 } |
| 701 | 701 |
| 702 ui::TextInputType NativeTextfieldViews::GetTextInputType() { | 702 ui::TextInputType NativeTextfieldViews::GetTextInputType() { |
| 703 if (textfield_->read_only() || !textfield_->IsEnabled()) | 703 if (textfield_->read_only() || !textfield_->IsEnabled()) |
| 704 return ui::TEXT_INPUT_TYPE_NONE; | 704 return ui::TEXT_INPUT_TYPE_NONE; |
| 705 else if (textfield_->IsPassword()) | 705 else if (textfield_->IsPassword()) |
| 706 return ui::TEXT_INPUT_TYPE_PASSWORD; | 706 return ui::TEXT_INPUT_TYPE_PASSWORD; |
| 707 else if (textfield_->IsUrl()) |
| 708 return ui::TEXT_INPUT_TYPE_URL; |
| 707 return ui::TEXT_INPUT_TYPE_TEXT; | 709 return ui::TEXT_INPUT_TYPE_TEXT; |
| 708 } | 710 } |
| 709 | 711 |
| 710 gfx::Rect NativeTextfieldViews::GetCaretBounds() { | 712 gfx::Rect NativeTextfieldViews::GetCaretBounds() { |
| 711 return GetRenderText()->GetUpdatedCursorBounds(); | 713 return GetRenderText()->GetUpdatedCursorBounds(); |
| 712 } | 714 } |
| 713 | 715 |
| 714 bool NativeTextfieldViews::HasCompositionText() { | 716 bool NativeTextfieldViews::HasCompositionText() { |
| 715 return model_->HasCompositionText(); | 717 return model_->HasCompositionText(); |
| 716 } | 718 } |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 | 1051 |
| 1050 #if defined(USE_AURA) | 1052 #if defined(USE_AURA) |
| 1051 // static | 1053 // static |
| 1052 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1054 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 1053 Textfield* field) { | 1055 Textfield* field) { |
| 1054 return new NativeTextfieldViews(field); | 1056 return new NativeTextfieldViews(field); |
| 1055 } | 1057 } |
| 1056 #endif | 1058 #endif |
| 1057 | 1059 |
| 1058 } // namespace views | 1060 } // namespace views |
| OLD | NEW |