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

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

Issue 12300008: Save/restore views omnibox selection on blur/focus, select all on click focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase. Created 7 years, 10 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 | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698