OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/textfield/native_textfield_views.h" | 5 #include "views/controls/textfield/native_textfield_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 bool NativeTextfieldViews::IsIMEComposing() const { | 269 bool NativeTextfieldViews::IsIMEComposing() const { |
270 return false; | 270 return false; |
271 } | 271 } |
272 | 272 |
273 void NativeTextfieldViews::GetSelectedRange(TextRange* range) const { | 273 void NativeTextfieldViews::GetSelectedRange(TextRange* range) const { |
274 model_->GetSelectedRange(range); | 274 model_->GetSelectedRange(range); |
275 } | 275 } |
276 | 276 |
277 void NativeTextfieldViews::SelectRange(const TextRange& range) { | 277 void NativeTextfieldViews::SelectRange(const TextRange& range) { |
278 model_->SelectRange(range); | 278 model_->SelectRange(range); |
| 279 UpdateCursorBoundsAndTextOffset(); |
279 SchedulePaint(); | 280 SchedulePaint(); |
280 } | 281 } |
281 | 282 |
282 size_t NativeTextfieldViews::GetCursorPosition() const { | 283 size_t NativeTextfieldViews::GetCursorPosition() const { |
283 return model_->cursor_pos(); | 284 return model_->cursor_pos(); |
284 } | 285 } |
285 | 286 |
286 bool NativeTextfieldViews::HandleKeyPressed(const views::KeyEvent& e) { | 287 bool NativeTextfieldViews::HandleKeyPressed(const views::KeyEvent& e) { |
287 Textfield::Controller* controller = textfield_->GetController(); | 288 Textfield::Controller* controller = textfield_->GetController(); |
288 bool handled = false; | 289 bool handled = false; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 } | 891 } |
891 | 892 |
892 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 893 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
893 int left, | 894 int left, |
894 int bottom, | 895 int bottom, |
895 int right) { | 896 int right) { |
896 insets_.Set(top, left, bottom, right); | 897 insets_.Set(top, left, bottom, right); |
897 } | 898 } |
898 | 899 |
899 } // namespace views | 900 } // namespace views |
OLD | NEW |