OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 //////////////////////////////////////////////////////////////////////////////// | 98 //////////////////////////////////////////////////////////////////////////////// |
99 // NativeTextfieldViews, View overrides: | 99 // NativeTextfieldViews, View overrides: |
100 | 100 |
101 bool NativeTextfieldViews::OnMousePressed(const ui::MouseEvent& event) { | 101 bool NativeTextfieldViews::OnMousePressed(const ui::MouseEvent& event) { |
102 OnBeforeUserAction(); | 102 OnBeforeUserAction(); |
103 TrackMouseClicks(event); | 103 TrackMouseClicks(event); |
104 | 104 |
105 TextfieldController* controller = textfield_->GetController(); | 105 TextfieldController* controller = textfield_->GetController(); |
106 if (!(controller && controller->HandleMouseEvent(textfield_, event)) || | 106 if (!(controller && controller->HandleMouseEvent(textfield_, event)) && |
107 // TODO: Remove once NativeTextfield implementations are consolidated to | |
108 // Textfield. | |
109 !textfield_->OnMousePressed(event)) { | 107 !textfield_->OnMousePressed(event)) { |
110 HandleMousePressEvent(event); | 108 HandleMousePressEvent(event); |
111 } | 109 } |
112 | 110 |
113 OnAfterUserAction(); | 111 OnAfterUserAction(); |
114 touch_selection_controller_.reset(); | 112 touch_selection_controller_.reset(); |
115 return true; | 113 return true; |
116 } | 114 } |
117 | 115 |
118 bool NativeTextfieldViews::ExceededDragThresholdFromLastClickLocation( | 116 bool NativeTextfieldViews::ExceededDragThresholdFromLastClickLocation( |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 | 1391 |
1394 void NativeTextfieldViews::PlatformGestureEventHandling( | 1392 void NativeTextfieldViews::PlatformGestureEventHandling( |
1395 const ui::GestureEvent* event) { | 1393 const ui::GestureEvent* event) { |
1396 #if defined(OS_WIN) && defined(USE_AURA) | 1394 #if defined(OS_WIN) && defined(USE_AURA) |
1397 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only()) | 1395 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only()) |
1398 base::win::DisplayVirtualKeyboard(); | 1396 base::win::DisplayVirtualKeyboard(); |
1399 #endif | 1397 #endif |
1400 } | 1398 } |
1401 | 1399 |
1402 } // namespace views | 1400 } // namespace views |
OLD | NEW |