Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: views/controls/textfield/native_textfield_views.cc

Issue 6004010: Implement clipboard features in views textfield. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Modified according to comments Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 bool control = key_event.IsControlDown(); 419 bool control = key_event.IsControlDown();
420 bool text_changed = false; 420 bool text_changed = false;
421 bool cursor_changed = false; 421 bool cursor_changed = false;
422 switch (key_code) { 422 switch (key_code) {
423 case app::VKEY_A: 423 case app::VKEY_A:
424 if (control) { 424 if (control) {
425 model_->SelectAll(); 425 model_->SelectAll();
426 cursor_changed = true; 426 cursor_changed = true;
427 } 427 }
428 break; 428 break;
429 case app::VKEY_X:
430 if (control) {
431 text_changed = model_->Cut();
432 }
oshima 2011/01/05 18:50:30 no need for {} for single line.
varunjain 2011/01/05 19:03:35 Done.
433 break;
434 case app::VKEY_C:
435 if (control) {
436 model_->Copy();
437 }
438 break;
439 case app::VKEY_V:
440 if (control) {
441 text_changed = model_->Paste();
442 }
443 break;
429 case app::VKEY_RIGHT: 444 case app::VKEY_RIGHT:
430 control ? model_->MoveCursorToNextWord(selection) 445 control ? model_->MoveCursorToNextWord(selection)
431 : model_->MoveCursorRight(selection); 446 : model_->MoveCursorRight(selection);
432 cursor_changed = true; 447 cursor_changed = true;
433 break; 448 break;
434 case app::VKEY_LEFT: 449 case app::VKEY_LEFT:
435 control ? model_->MoveCursorToPreviousWord(selection) 450 control ? model_->MoveCursorToPreviousWord(selection)
436 : model_->MoveCursorLeft(selection); 451 : model_->MoveCursorLeft(selection);
437 cursor_changed = true; 452 cursor_changed = true;
438 break; 453 break;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 704 }
690 705
691 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, 706 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top,
692 int left, 707 int left,
693 int bottom, 708 int bottom,
694 int right) { 709 int right) {
695 insets_.Set(top, left, bottom, right); 710 insets_.Set(top, left, bottom, right);
696 } 711 }
697 712
698 } // namespace views 713 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698