| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 gfx::NativeView NativeTextfieldViews::GetTestingHandle() const { | 268 gfx::NativeView NativeTextfieldViews::GetTestingHandle() const { |
| 269 NOTREACHED(); | 269 NOTREACHED(); |
| 270 return NULL; | 270 return NULL; |
| 271 } | 271 } |
| 272 | 272 |
| 273 bool NativeTextfieldViews::IsIMEComposing() const { | 273 bool NativeTextfieldViews::IsIMEComposing() const { |
| 274 return false; | 274 return false; |
| 275 } | 275 } |
| 276 | 276 |
| 277 void NativeTextfieldViews::GetSelectedRange(TextRange* range) const { |
| 278 model_->GetSelectedRange(range); |
| 279 } |
| 280 |
| 281 void NativeTextfieldViews::SelectRange(const TextRange& range) { |
| 282 model_->SelectRange(range); |
| 283 SchedulePaint(); |
| 284 } |
| 285 |
| 286 size_t NativeTextfieldViews::GetCursorPosition() const { |
| 287 return model_->cursor_pos(); |
| 288 } |
| 289 |
| 277 bool NativeTextfieldViews::HandleKeyPressed(const views::KeyEvent& e) { | 290 bool NativeTextfieldViews::HandleKeyPressed(const views::KeyEvent& e) { |
| 278 Textfield::Controller* controller = textfield_->GetController(); | 291 Textfield::Controller* controller = textfield_->GetController(); |
| 279 bool handled = false; | 292 bool handled = false; |
| 280 if (controller) { | 293 if (controller) |
| 281 handled = controller->HandleKeyEvent(textfield_, e); | 294 handled = controller->HandleKeyEvent(textfield_, e); |
| 282 } | |
| 283 return handled || HandleKeyEvent(e); | 295 return handled || HandleKeyEvent(e); |
| 284 } | 296 } |
| 285 | 297 |
| 286 bool NativeTextfieldViews::HandleKeyReleased(const views::KeyEvent& e) { | 298 bool NativeTextfieldViews::HandleKeyReleased(const views::KeyEvent& e) { |
| 287 return true; | 299 return true; |
| 288 } | 300 } |
| 289 | 301 |
| 290 void NativeTextfieldViews::HandleWillGainFocus() { | 302 void NativeTextfieldViews::HandleWillGainFocus() { |
| 291 } | 303 } |
| 292 | 304 |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 } | 843 } |
| 832 | 844 |
| 833 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 845 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 834 int left, | 846 int left, |
| 835 int bottom, | 847 int bottom, |
| 836 int right) { | 848 int right) { |
| 837 insets_.Set(top, left, bottom, right); | 849 insets_.Set(top, left, bottom, right); |
| 838 } | 850 } |
| 839 | 851 |
| 840 } // namespace views | 852 } // namespace views |
| OLD | NEW |