Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: ui/views/controls/prefix_selector.cc

Issue 2007503002: Views: Replace resource ids with ui::TextEditCommand enum for text editing commands in Textfield. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added file deleted during rename. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) { 138 bool PrefixSelector::IsEditCommandEnabled(ui::TextEditCommand command) const {
139 return false; 139 return false;
140 } 140 }
141 141
142 void PrefixSelector::SetEditCommandForNextKeyEvent(int command_id) { 142 void PrefixSelector::SetEditCommandForNextKeyEvent(
143 } 143 ui::TextEditCommand command) {}
144 144
145 void PrefixSelector::OnTextInput(const base::string16& text) { 145 void PrefixSelector::OnTextInput(const base::string16& text) {
146 // Small hack to filter out 'tab' and 'enter' input, as the expectation is 146 // 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 147 // that they are control characters and will not affect the currently-active
148 // prefix. 148 // prefix.
149 if (text.length() == 1 && 149 if (text.length() == 1 &&
150 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n')) 150 (text[0] == L'\t' || text[0] == L'\r' || text[0] == L'\n'))
151 return; 151 return;
152 152
153 const int row_count = prefix_delegate_->GetRowCount(); 153 const int row_count = prefix_delegate_->GetRowCount();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return (model_text.size() >= lower_text.size()) && 187 return (model_text.size() >= lower_text.size()) &&
188 (model_text.compare(0, lower_text.size(), lower_text) == 0); 188 (model_text.compare(0, lower_text.size(), lower_text) == 0);
189 } 189 }
190 190
191 void PrefixSelector::ClearText() { 191 void PrefixSelector::ClearText() {
192 current_text_.clear(); 192 current_text_.clear();
193 time_of_last_key_ = base::TimeTicks(); 193 time_of_last_key_ = base::TimeTicks();
194 } 194 }
195 195
196 } // namespace views 196 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698