| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 void PrefixSelector::OnCandidateWindowHidden() { | 147 void PrefixSelector::OnCandidateWindowHidden() { |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool PrefixSelector::IsEditingCommandEnabled(int command_id) { | 150 bool PrefixSelector::IsEditingCommandEnabled(int command_id) { |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 | 153 |
| 154 void PrefixSelector::ExecuteEditingCommand(int command_id) { | 154 void PrefixSelector::ExecuteEditingCommand(int command_id) { |
| 155 } | 155 } |
| 156 | 156 |
| 157 void PrefixSelector::OnKeyboardBoundsUnchanged() { |
| 158 } |
| 159 |
| 157 void PrefixSelector::OnTextInput(const base::string16& text) { | 160 void PrefixSelector::OnTextInput(const base::string16& text) { |
| 158 // Small hack to filter out 'tab' and 'enter' input, as the expectation is | 161 // Small hack to filter out 'tab' and 'enter' input, as the expectation is |
| 159 // that they are control characters and will not affect the currently-active | 162 // that they are control characters and will not affect the currently-active |
| 160 // prefix. | 163 // prefix. |
| 161 if (text.length() == 1 && | 164 if (text.length() == 1 && |
| 162 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) | 165 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) |
| 163 return; | 166 return; |
| 164 | 167 |
| 165 const int row_count = prefix_delegate_->GetRowCount(); | 168 const int row_count = prefix_delegate_->GetRowCount(); |
| 166 if (row_count == 0) | 169 if (row_count == 0) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 return (model_text.size() >= lower_text.size()) && | 202 return (model_text.size() >= lower_text.size()) && |
| 200 (model_text.compare(0, lower_text.size(), lower_text) == 0); | 203 (model_text.compare(0, lower_text.size(), lower_text) == 0); |
| 201 } | 204 } |
| 202 | 205 |
| 203 void PrefixSelector::ClearText() { | 206 void PrefixSelector::ClearText() { |
| 204 current_text_.clear(); | 207 current_text_.clear(); |
| 205 time_of_last_key_ = base::TimeTicks(); | 208 time_of_last_key_ = base::TimeTicks(); |
| 206 } | 209 } |
| 207 | 210 |
| 208 } // namespace views | 211 } // namespace views |
| OLD | NEW |