OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 bool control = key_event.IsControlDown(); | 438 bool control = key_event.IsControlDown(); |
439 bool text_changed = false; | 439 bool text_changed = false; |
440 bool cursor_changed = false; | 440 bool cursor_changed = false; |
441 switch (key_code) { | 441 switch (key_code) { |
442 case app::VKEY_A: | 442 case app::VKEY_A: |
443 if (control) { | 443 if (control) { |
444 model_->SelectAll(); | 444 model_->SelectAll(); |
445 cursor_changed = true; | 445 cursor_changed = true; |
446 } | 446 } |
447 break; | 447 break; |
| 448 case app::VKEY_X: |
| 449 if (control) |
| 450 text_changed = model_->Cut(); |
| 451 break; |
| 452 case app::VKEY_C: |
| 453 if (control) |
| 454 model_->Copy(); |
| 455 break; |
| 456 case app::VKEY_V: |
| 457 if (control) |
| 458 text_changed = model_->Paste(); |
| 459 break; |
448 case app::VKEY_RIGHT: | 460 case app::VKEY_RIGHT: |
449 control ? model_->MoveCursorToNextWord(selection) | 461 control ? model_->MoveCursorToNextWord(selection) |
450 : model_->MoveCursorRight(selection); | 462 : model_->MoveCursorRight(selection); |
451 cursor_changed = true; | 463 cursor_changed = true; |
452 break; | 464 break; |
453 case app::VKEY_LEFT: | 465 case app::VKEY_LEFT: |
454 control ? model_->MoveCursorToPreviousWord(selection) | 466 control ? model_->MoveCursorToPreviousWord(selection) |
455 : model_->MoveCursorLeft(selection); | 467 : model_->MoveCursorLeft(selection); |
456 cursor_changed = true; | 468 cursor_changed = true; |
457 break; | 469 break; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 } | 754 } |
743 | 755 |
744 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 756 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
745 int left, | 757 int left, |
746 int bottom, | 758 int bottom, |
747 int right) { | 759 int right) { |
748 insets_.Set(top, left, bottom, right); | 760 insets_.Set(top, left, bottom, right); |
749 } | 761 } |
750 | 762 |
751 } // namespace views | 763 } // namespace views |
OLD | NEW |