| 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/input_method.h" | 8 #include "ui/base/ime/input_method.h" |
| 9 #include "ui/base/ime/text_input_type.h" | 9 #include "ui/base/ime/text_input_type.h" |
| 10 #include "ui/gfx/range/range.h" | 10 #include "ui/gfx/range/range.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 base::i18n::TextDirection direction) { | 128 base::i18n::TextDirection direction) { |
| 129 return true; | 129 return true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 void PrefixSelector::ExtendSelectionAndDelete(size_t before, size_t after) { | 132 void PrefixSelector::ExtendSelectionAndDelete(size_t before, size_t after) { |
| 133 } | 133 } |
| 134 | 134 |
| 135 void PrefixSelector::EnsureCaretInRect(const gfx::Rect& rect) { | 135 void PrefixSelector::EnsureCaretInRect(const gfx::Rect& rect) { |
| 136 } | 136 } |
| 137 | 137 |
| 138 bool PrefixSelector::IsEditCommandEnabled(int command_id) const { | 138 bool PrefixSelector::IsTextEditCommandEnabled( |
| 139 ui::TextEditCommand command) const { |
| 139 return false; | 140 return false; |
| 140 } | 141 } |
| 141 | 142 |
| 142 void PrefixSelector::SetEditCommandForNextKeyEvent(int command_id) { | 143 void PrefixSelector::SetTextEditCommandForNextKeyEvent( |
| 143 } | 144 ui::TextEditCommand command) {} |
| 144 | 145 |
| 145 void PrefixSelector::OnTextInput(const base::string16& text) { | 146 void PrefixSelector::OnTextInput(const base::string16& text) { |
| 146 // Small hack to filter out 'tab' and 'enter' input, as the expectation is | 147 // Small hack to filter out 'tab' and 'enter' input, as the expectation is |
| 147 // that they are control characters and will not affect the currently-active | 148 // that they are control characters and will not affect the currently-active |
| 148 // prefix. | 149 // prefix. |
| 149 if (text.length() == 1 && | 150 if (text.length() == 1 && |
| 150 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) | 151 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) |
| 151 return; | 152 return; |
| 152 | 153 |
| 153 const int row_count = prefix_delegate_->GetRowCount(); | 154 const int row_count = prefix_delegate_->GetRowCount(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 return (model_text.size() >= lower_text.size()) && | 188 return (model_text.size() >= lower_text.size()) && |
| 188 (model_text.compare(0, lower_text.size(), lower_text) == 0); | 189 (model_text.compare(0, lower_text.size(), lower_text) == 0); |
| 189 } | 190 } |
| 190 | 191 |
| 191 void PrefixSelector::ClearText() { | 192 void PrefixSelector::ClearText() { |
| 192 current_text_.clear(); | 193 current_text_.clear(); |
| 193 time_of_last_key_ = base::TimeTicks(); | 194 time_of_last_key_ = base::TimeTicks(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace views | 197 } // namespace views |
| OLD | NEW |