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/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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 bool can_drag = true; | 1260 bool can_drag = true; |
1261 | 1261 |
1262 switch (aggregated_clicks_) { | 1262 switch (aggregated_clicks_) { |
1263 case 0: | 1263 case 0: |
1264 if (can_drag && GetRenderText()->IsPointInSelection(event.location())) | 1264 if (can_drag && GetRenderText()->IsPointInSelection(event.location())) |
1265 initiating_drag_ = true; | 1265 initiating_drag_ = true; |
1266 else | 1266 else |
1267 MoveCursorTo(event.location(), event.IsShiftDown()); | 1267 MoveCursorTo(event.location(), event.IsShiftDown()); |
1268 break; | 1268 break; |
1269 case 1: | 1269 case 1: |
| 1270 MoveCursorTo(event.location(), false); |
1270 model_->SelectWord(); | 1271 model_->SelectWord(); |
1271 OnCaretBoundsChanged(); | 1272 OnCaretBoundsChanged(); |
1272 break; | 1273 break; |
1273 case 2: | 1274 case 2: |
1274 model_->SelectAll(false); | 1275 model_->SelectAll(false); |
1275 OnCaretBoundsChanged(); | 1276 OnCaretBoundsChanged(); |
1276 break; | 1277 break; |
1277 default: | 1278 default: |
1278 NOTREACHED(); | 1279 NOTREACHED(); |
1279 } | 1280 } |
(...skipping 13 matching lines...) Expand all Loading... |
1293 // Filter out all control characters, including tab and new line characters, | 1294 // Filter out all control characters, including tab and new line characters, |
1294 // and all characters with Alt modifier. But we need to allow characters with | 1295 // and all characters with Alt modifier. But we need to allow characters with |
1295 // AltGr modifier. | 1296 // AltGr modifier. |
1296 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different | 1297 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different |
1297 // flag that we don't care about. | 1298 // flag that we don't care about. |
1298 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && | 1299 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && |
1299 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; | 1300 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; |
1300 } | 1301 } |
1301 | 1302 |
1302 } // namespace views | 1303 } // namespace views |
OLD | NEW |