| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/prefix_selector.h" | 5 #include "ui/views/controls/prefix_selector.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "ui/base/ime/text_input_type.h" | 8 #include "ui/base/ime/text_input_type.h" |
| 9 #include "ui/gfx/range/range.h" | 9 #include "ui/gfx/range/range.h" |
| 10 #include "ui/views/controls/prefix_delegate.h" | 10 #include "ui/views/controls/prefix_delegate.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 void PrefixSelector::InsertText(const base::string16& text) { | 50 void PrefixSelector::InsertText(const base::string16& text) { |
| 51 OnTextInput(text); | 51 OnTextInput(text); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void PrefixSelector::InsertChar(base::char16 ch, int flags) { | 54 void PrefixSelector::InsertChar(base::char16 ch, int flags) { |
| 55 OnTextInput(base::string16(1, ch)); | 55 OnTextInput(base::string16(1, ch)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 gfx::NativeWindow PrefixSelector::GetAttachedWindow() const { | |
| 59 return prefix_delegate_->GetWidget()->GetNativeWindow(); | |
| 60 } | |
| 61 | |
| 62 ui::TextInputType PrefixSelector::GetTextInputType() const { | 58 ui::TextInputType PrefixSelector::GetTextInputType() const { |
| 63 return ui::TEXT_INPUT_TYPE_TEXT; | 59 return ui::TEXT_INPUT_TYPE_TEXT; |
| 64 } | 60 } |
| 65 | 61 |
| 66 ui::TextInputMode PrefixSelector::GetTextInputMode() const { | 62 ui::TextInputMode PrefixSelector::GetTextInputMode() const { |
| 67 return ui::TEXT_INPUT_MODE_DEFAULT; | 63 return ui::TEXT_INPUT_MODE_DEFAULT; |
| 68 } | 64 } |
| 69 | 65 |
| 70 int PrefixSelector::GetTextInputFlags() const { | 66 int PrefixSelector::GetTextInputFlags() const { |
| 71 return 0; | 67 return 0; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 return (model_text.size() >= lower_text.size()) && | 186 return (model_text.size() >= lower_text.size()) && |
| 191 (model_text.compare(0, lower_text.size(), lower_text) == 0); | 187 (model_text.compare(0, lower_text.size(), lower_text) == 0); |
| 192 } | 188 } |
| 193 | 189 |
| 194 void PrefixSelector::ClearText() { | 190 void PrefixSelector::ClearText() { |
| 195 current_text_.clear(); | 191 current_text_.clear(); |
| 196 time_of_last_key_ = base::TimeTicks(); | 192 time_of_last_key_ = base::TimeTicks(); |
| 197 } | 193 } |
| 198 | 194 |
| 199 } // namespace views | 195 } // namespace views |
| OLD | NEW |