Chromium Code Reviews| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 skip_input_method_cancel_composition_ = true; | 692 skip_input_method_cancel_composition_ = true; |
| 693 if (GetRenderText()->insert_mode()) | 693 if (GetRenderText()->insert_mode()) |
| 694 model_->InsertChar(ch); | 694 model_->InsertChar(ch); |
| 695 else | 695 else |
| 696 model_->ReplaceChar(ch); | 696 model_->ReplaceChar(ch); |
| 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() { |
|
oshima
2011/09/02 22:00:10
looks like we can move this to Textfield?
bryeung
2011/09/02 23:33:11
It's actually an override from TextInputClient (wh
oshima
2011/09/03 00:26:32
I see, then just move the following to Textfield.
| |
| 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 return textfield_->GetTextInputType(); |
| 706 return ui::TEXT_INPUT_TYPE_PASSWORD; | |
| 707 return ui::TEXT_INPUT_TYPE_TEXT; | |
| 708 } | 706 } |
| 709 | 707 |
| 710 gfx::Rect NativeTextfieldViews::GetCaretBounds() { | 708 gfx::Rect NativeTextfieldViews::GetCaretBounds() { |
| 711 return GetRenderText()->GetUpdatedCursorBounds(); | 709 return GetRenderText()->GetUpdatedCursorBounds(); |
| 712 } | 710 } |
| 713 | 711 |
| 714 bool NativeTextfieldViews::HasCompositionText() { | 712 bool NativeTextfieldViews::HasCompositionText() { |
| 715 return model_->HasCompositionText(); | 713 return model_->HasCompositionText(); |
| 716 } | 714 } |
| 717 | 715 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1049 | 1047 |
| 1050 #if defined(USE_AURA) | 1048 #if defined(USE_AURA) |
| 1051 // static | 1049 // static |
| 1052 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1050 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 1053 Textfield* field) { | 1051 Textfield* field) { |
| 1054 return new NativeTextfieldViews(field); | 1052 return new NativeTextfieldViews(field); |
| 1055 } | 1053 } |
| 1056 #endif | 1054 #endif |
| 1057 | 1055 |
| 1058 } // namespace views | 1056 } // namespace views |
| OLD | NEW |