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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 break; | 459 break; |
| 460 } | 460 } |
| 461 char16 print_char = GetPrintableChar(key_event); | 461 char16 print_char = GetPrintableChar(key_event); |
| 462 if (!control && print_char) { | 462 if (!control && print_char) { |
| 463 if (insert_) | 463 if (insert_) |
| 464 model_->Insert(print_char); | 464 model_->Insert(print_char); |
| 465 else | 465 else |
| 466 model_->Replace(print_char); | 466 model_->Replace(print_char); |
| 467 text_changed = true; | 467 text_changed = true; |
| 468 } | 468 } |
| 469 if (control && (key_code == app::VKEY_X || key_code == app::VKEY_C || | |
| 470 key_code == app::VKEY_V)) { | |
| 471 text_changed = model_->HandleClipboardEvents(key_code); | |
|
oshima
2011/01/04 22:36:49
I think it's more consistent to have Cut&Copy&Past
varunjain
2011/01/05 16:19:31
Done.
| |
| 472 } | |
| 469 if (text_changed) { | 473 if (text_changed) { |
| 470 textfield_->SyncText(); | 474 textfield_->SyncText(); |
| 471 Textfield::Controller* controller = textfield_->GetController(); | 475 Textfield::Controller* controller = textfield_->GetController(); |
| 472 if (controller) | 476 if (controller) |
| 473 controller->ContentsChanged(textfield_, GetText()); | 477 controller->ContentsChanged(textfield_, GetText()); |
| 474 } | 478 } |
| 475 if (text_changed || cursor_changed) { | 479 if (text_changed || cursor_changed) { |
| 476 UpdateCursorBoundsAndTextOffset(); | 480 UpdateCursorBoundsAndTextOffset(); |
| 477 SchedulePaint(); | 481 SchedulePaint(); |
| 478 } | 482 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 689 } | 693 } |
| 690 | 694 |
| 691 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 695 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 692 int left, | 696 int left, |
| 693 int bottom, | 697 int bottom, |
| 694 int right) { | 698 int right) { |
| 695 insets_.Set(top, left, bottom, right); | 699 insets_.Set(top, left, bottom, right); |
| 696 } | 700 } |
| 697 | 701 |
| 698 } // namespace views | 702 } // namespace views |
| OLD | NEW |