| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "ui/views/drag_utils.h" | 39 #include "ui/views/drag_utils.h" |
| 40 #include "ui/views/metrics.h" | 40 #include "ui/views/metrics.h" |
| 41 #include "ui/views/native_cursor.h" | 41 #include "ui/views/native_cursor.h" |
| 42 #include "ui/views/painter.h" | 42 #include "ui/views/painter.h" |
| 43 #include "ui/views/style/platform_style.h" | 43 #include "ui/views/style/platform_style.h" |
| 44 #include "ui/views/views_delegate.h" | 44 #include "ui/views/views_delegate.h" |
| 45 #include "ui/views/widget/widget.h" | 45 #include "ui/views/widget/widget.h" |
| 46 | 46 |
| 47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 48 #include "base/win/win_util.h" | 48 #include "base/win/win_util.h" |
| 49 #include "ui/base/win/osk_display_manager.h" |
| 49 #endif | 50 #endif |
| 50 | 51 |
| 51 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 52 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 52 #include "base/strings/utf_string_conversions.h" | 53 #include "base/strings/utf_string_conversions.h" |
| 53 #include "ui/events/linux/text_edit_command_auralinux.h" | 54 #include "ui/events/linux/text_edit_command_auralinux.h" |
| 54 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" | 55 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" |
| 55 #endif | 56 #endif |
| 56 | 57 |
| 57 namespace views { | 58 namespace views { |
| 58 | 59 |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 OnBeforeUserAction(); | 762 OnBeforeUserAction(); |
| 762 SelectWordAt(event->location()); | 763 SelectWordAt(event->location()); |
| 763 OnAfterUserAction(); | 764 OnAfterUserAction(); |
| 764 } else { | 765 } else { |
| 765 OnBeforeUserAction(); | 766 OnBeforeUserAction(); |
| 766 SelectAll(false); | 767 SelectAll(false); |
| 767 OnAfterUserAction(); | 768 OnAfterUserAction(); |
| 768 } | 769 } |
| 769 CreateTouchSelectionControllerAndNotifyIt(); | 770 CreateTouchSelectionControllerAndNotifyIt(); |
| 770 #if defined(OS_WIN) | 771 #if defined(OS_WIN) |
| 771 if (!read_only()) | 772 if (!read_only()) { |
| 772 base::win::DisplayVirtualKeyboard(); | 773 DCHECK(ui::OnScreenKeyboardDisplayManager::GetInstance()); |
| 774 ui::OnScreenKeyboardDisplayManager::GetInstance() |
| 775 ->DisplayVirtualKeyboard(nullptr); |
| 776 } |
| 773 #endif | 777 #endif |
| 774 event->SetHandled(); | 778 event->SetHandled(); |
| 775 break; | 779 break; |
| 776 case ui::ET_GESTURE_LONG_PRESS: | 780 case ui::ET_GESTURE_LONG_PRESS: |
| 777 if (!GetRenderText()->IsPointInSelection(event->location())) { | 781 if (!GetRenderText()->IsPointInSelection(event->location())) { |
| 778 // If long-press happens outside selection, select word and try to | 782 // If long-press happens outside selection, select word and try to |
| 779 // activate touch selection. | 783 // activate touch selection. |
| 780 OnBeforeUserAction(); | 784 OnBeforeUserAction(); |
| 781 SelectWordAt(event->location()); | 785 SelectWordAt(event->location()); |
| 782 OnAfterUserAction(); | 786 OnAfterUserAction(); |
| (...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 RequestFocus(); | 1933 RequestFocus(); |
| 1930 model_->MoveCursorTo(mouse); | 1934 model_->MoveCursorTo(mouse); |
| 1931 if (!selection_clipboard_text.empty()) { | 1935 if (!selection_clipboard_text.empty()) { |
| 1932 model_->InsertText(selection_clipboard_text); | 1936 model_->InsertText(selection_clipboard_text); |
| 1933 UpdateAfterChange(true, true); | 1937 UpdateAfterChange(true, true); |
| 1934 } | 1938 } |
| 1935 OnAfterUserAction(); | 1939 OnAfterUserAction(); |
| 1936 } | 1940 } |
| 1937 | 1941 |
| 1938 } // namespace views | 1942 } // namespace views |
| OLD | NEW |