| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 void PrefixSelector::OnCandidateWindowShown() { | 137 void PrefixSelector::OnCandidateWindowShown() { |
| 138 } | 138 } |
| 139 | 139 |
| 140 void PrefixSelector::OnCandidateWindowUpdated() { | 140 void PrefixSelector::OnCandidateWindowUpdated() { |
| 141 } | 141 } |
| 142 | 142 |
| 143 void PrefixSelector::OnCandidateWindowHidden() { | 143 void PrefixSelector::OnCandidateWindowHidden() { |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool PrefixSelector::IsEditingCommandEnabled(int command_id) { |
| 147 return false; |
| 148 } |
| 149 |
| 150 void PrefixSelector::ExecuteEditingCommand(int command_id) { |
| 151 } |
| 152 |
| 146 void PrefixSelector::OnTextInput(const base::string16& text) { | 153 void PrefixSelector::OnTextInput(const base::string16& text) { |
| 147 // Small hack to filter out 'tab' and 'enter' input, as the expectation is | 154 // Small hack to filter out 'tab' and 'enter' input, as the expectation is |
| 148 // that they are control characters and will not affect the currently-active | 155 // that they are control characters and will not affect the currently-active |
| 149 // prefix. | 156 // prefix. |
| 150 if (text.length() == 1 && | 157 if (text.length() == 1 && |
| 151 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) | 158 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) |
| 152 return; | 159 return; |
| 153 | 160 |
| 154 const int row_count = prefix_delegate_->GetRowCount(); | 161 const int row_count = prefix_delegate_->GetRowCount(); |
| 155 if (row_count == 0) | 162 if (row_count == 0) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return (model_text.size() >= lower_text.size()) && | 195 return (model_text.size() >= lower_text.size()) && |
| 189 (model_text.compare(0, lower_text.size(), lower_text) == 0); | 196 (model_text.compare(0, lower_text.size(), lower_text) == 0); |
| 190 } | 197 } |
| 191 | 198 |
| 192 void PrefixSelector::ClearText() { | 199 void PrefixSelector::ClearText() { |
| 193 current_text_.clear(); | 200 current_text_.clear(); |
| 194 time_of_last_key_ = base::TimeTicks(); | 201 time_of_last_key_ = base::TimeTicks(); |
| 195 } | 202 } |
| 196 | 203 |
| 197 } // namespace views | 204 } // namespace views |
| OLD | NEW |