Chromium Code Reviews| Index: views/controls/textfield/native_textfield_views.cc |
| diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc |
| index 677ada55632d2dc9aef7ae18002dbc59173ed3fb..0a5a3b8a7ff8a4dc76071c584d6f9b9d0946eea9 100644 |
| --- a/views/controls/textfield/native_textfield_views.cc |
| +++ b/views/controls/textfield/native_textfield_views.cc |
| @@ -464,6 +464,16 @@ bool NativeTextfieldViews::HandleKeyEvent(const KeyEvent& key_event) { |
| cursor_changed = true; |
| break; |
| case app::VKEY_BACK: |
| + if (!model_->HasSelection()) { |
| + if (selection && control) { |
| + // If both shift and control are pressed, then erase upto the |
| + // beginning of the buffer. |
| + model_->MoveCursorToStart(true); |
| + } else if (control) { |
| + // Otherwise, if control is pressed, then erase the previous word. |
| + model_->MoveCursorToPreviousWord(true); |
| + } |
| + } |
|
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
|
| text_changed = model_->Backspace(); |
| cursor_changed = true; |
| break; |