Chromium Code Reviews| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 break; | 457 break; |
| 458 case app::VKEY_END: | 458 case app::VKEY_END: |
| 459 model_->MoveCursorToEnd(selection); | 459 model_->MoveCursorToEnd(selection); |
| 460 cursor_changed = true; | 460 cursor_changed = true; |
| 461 break; | 461 break; |
| 462 case app::VKEY_HOME: | 462 case app::VKEY_HOME: |
| 463 model_->MoveCursorToStart(selection); | 463 model_->MoveCursorToStart(selection); |
| 464 cursor_changed = true; | 464 cursor_changed = true; |
| 465 break; | 465 break; |
| 466 case app::VKEY_BACK: | 466 case app::VKEY_BACK: |
| 467 if (!model_->HasSelection()) { | |
| 468 if (selection && control) { | |
| 469 // If both shift and control are pressed, then erase upto the | |
| 470 // beginning of the buffer. | |
| 471 model_->MoveCursorToStart(true); | |
| 472 } else if (control) { | |
| 473 // Otherwise, if control is pressed, then erase the previous word. | |
| 474 model_->MoveCursorToPreviousWord(true); | |
| 475 } | |
| 476 } | |
|
oshima
2011/01/10 23:15:17
are we going to implement gtk behavior? If so, ctr
sadrul
2011/01/11 04:46:55
I did some testing, out of curiosity, and the beha
| |
| 467 text_changed = model_->Backspace(); | 477 text_changed = model_->Backspace(); |
| 468 cursor_changed = true; | 478 cursor_changed = true; |
| 469 break; | 479 break; |
| 470 case app::VKEY_DELETE: | 480 case app::VKEY_DELETE: |
| 471 text_changed = model_->Delete(); | 481 text_changed = model_->Delete(); |
| 472 break; | 482 break; |
| 473 case app::VKEY_INSERT: | 483 case app::VKEY_INSERT: |
| 474 insert_ = !insert_; | 484 insert_ = !insert_; |
| 475 cursor_changed = true; | 485 cursor_changed = true; |
| 476 break; | 486 break; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 714 } | 724 } |
| 715 | 725 |
| 716 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 726 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 717 int left, | 727 int left, |
| 718 int bottom, | 728 int bottom, |
| 719 int right) { | 729 int right) { |
| 720 insets_.Set(top, left, bottom, right); | 730 insets_.Set(top, left, bottom, right); |
| 721 } | 731 } |
| 722 | 732 |
| 723 } // namespace views | 733 } // namespace views |
| OLD | NEW |