OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "grit/ui_strings.h" | 10 #include "grit/ui_strings.h" |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 break; | 669 break; |
670 case ui::ET_GESTURE_TAP: | 670 case ui::ET_GESTURE_TAP: |
671 if (event->details().tap_count() == 1) { | 671 if (event->details().tap_count() == 1) { |
672 CreateTouchSelectionControllerAndNotifyIt(); | 672 CreateTouchSelectionControllerAndNotifyIt(); |
673 } else { | 673 } else { |
674 OnBeforeUserAction(); | 674 OnBeforeUserAction(); |
675 SelectAll(false); | 675 SelectAll(false); |
676 OnAfterUserAction(); | 676 OnAfterUserAction(); |
677 event->SetHandled(); | 677 event->SetHandled(); |
678 } | 678 } |
679 #if defined(OS_WIN) && defined(USE_AURA) | 679 #if defined(OS_WIN) |
680 if (!read_only()) | 680 if (!read_only()) |
681 base::win::DisplayVirtualKeyboard(); | 681 base::win::DisplayVirtualKeyboard(); |
682 #endif | 682 #endif |
683 break; | 683 break; |
684 case ui::ET_GESTURE_LONG_PRESS: | 684 case ui::ET_GESTURE_LONG_PRESS: |
685 // If long press happens outside selection, select word and show context | 685 // If long press happens outside selection, select word and show context |
686 // menu (If touch selection is enabled, context menu is shown by the | 686 // menu (If touch selection is enabled, context menu is shown by the |
687 // |touch_selection_controller_|, hence we mark the event handled. | 687 // |touch_selection_controller_|, hence we mark the event handled. |
688 // Otherwise, the regular context menu will be shown by views). | 688 // Otherwise, the regular context menu will be shown by views). |
689 // If long press happens in selected text and touch drag drop is enabled, | 689 // If long press happens in selected text and touch drag drop is enabled, |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 const size_t length = selection_clipboard_text.length(); | 1491 const size_t length = selection_clipboard_text.length(); |
1492 range = gfx::Range(range.start() + length, range.end() + length); | 1492 range = gfx::Range(range.start() + length, range.end() + length); |
1493 } | 1493 } |
1494 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); | 1494 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); |
1495 UpdateAfterChange(true, true); | 1495 UpdateAfterChange(true, true); |
1496 OnAfterUserAction(); | 1496 OnAfterUserAction(); |
1497 } | 1497 } |
1498 } | 1498 } |
1499 | 1499 |
1500 } // namespace views | 1500 } // namespace views |
OLD | NEW |