Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: ui/views/controls/textfield/native_textfield_views.cc

Issue 12432019: Merge 187643 "Fix views omnibox unfocused double-click behavior." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698