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

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

Issue 14439009: Revert 196446 "Make touch drag drop and touch editing flags tri-..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 | « trunk/src/ui/ui.gyp ('k') | trunk/src/ui/views/touchui/touch_selection_controller_impl.cc » ('j') | 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"
11 #include "base/command_line.h"
11 #include "base/debug/trace_event.h" 12 #include "base/debug/trace_event.h"
12 #include "base/i18n/case_conversion.h" 13 #include "base/i18n/case_conversion.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/message_loop.h" 15 #include "base/message_loop.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "grit/app_locale_settings.h" 17 #include "grit/app_locale_settings.h"
17 #include "grit/ui_strings.h" 18 #include "grit/ui_strings.h"
18 #include "third_party/icu/public/common/unicode/uchar.h" 19 #include "third_party/icu/public/common/unicode/uchar.h"
19 #include "third_party/skia/include/core/SkColor.h" 20 #include "third_party/skia/include/core/SkColor.h"
20 #include "ui/base/clipboard/clipboard.h" 21 #include "ui/base/clipboard/clipboard.h"
21 #include "ui/base/dragdrop/drag_drop_types.h" 22 #include "ui/base/dragdrop/drag_drop_types.h"
22 #include "ui/base/dragdrop/drag_utils.h" 23 #include "ui/base/dragdrop/drag_utils.h"
23 #include "ui/base/events/event.h" 24 #include "ui/base/events/event.h"
24 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/range/range.h" 26 #include "ui/base/range/range.h"
26 #include "ui/base/ui_base_switches_util.h" 27 #include "ui/base/ui_base_switches.h"
27 #include "ui/compositor/layer.h" 28 #include "ui/compositor/layer.h"
28 #include "ui/gfx/canvas.h" 29 #include "ui/gfx/canvas.h"
29 #include "ui/gfx/insets.h" 30 #include "ui/gfx/insets.h"
30 #include "ui/gfx/render_text.h" 31 #include "ui/gfx/render_text.h"
31 #include "ui/gfx/text_constants.h" 32 #include "ui/gfx/text_constants.h"
32 #include "ui/native_theme/native_theme.h" 33 #include "ui/native_theme/native_theme.h"
33 #include "ui/views/background.h" 34 #include "ui/views/background.h"
34 #include "ui/views/border.h" 35 #include "ui/views/border.h"
35 #include "ui/views/controls/focusable_border.h" 36 #include "ui/views/controls/focusable_border.h"
36 #include "ui/views/controls/menu/menu_item_view.h" 37 #include "ui/views/controls/menu/menu_item_view.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (!GetRenderText()->IsPointInSelection(event->location())) { 194 if (!GetRenderText()->IsPointInSelection(event->location())) {
194 OnBeforeUserAction(); 195 OnBeforeUserAction();
195 model_->SelectWord(); 196 model_->SelectWord();
196 touch_selection_controller_.reset( 197 touch_selection_controller_.reset(
197 ui::TouchSelectionController::create(this)); 198 ui::TouchSelectionController::create(this));
198 OnCaretBoundsChanged(); 199 OnCaretBoundsChanged();
199 SchedulePaint(); 200 SchedulePaint();
200 OnAfterUserAction(); 201 OnAfterUserAction();
201 if (touch_selection_controller_.get()) 202 if (touch_selection_controller_.get())
202 event->SetHandled(); 203 event->SetHandled();
203 } else if (switches::IsTouchDragDropEnabled()) { 204 } else if (CommandLine::ForCurrentProcess()->HasSwitch(
205 switches::kEnableTouchDragDrop)) {
204 touch_selection_controller_.reset(); 206 touch_selection_controller_.reset();
205 } else { 207 } else {
206 if (!touch_selection_controller_.get()) 208 if (!touch_selection_controller_.get())
207 CreateTouchSelectionControllerAndNotifyIt(); 209 CreateTouchSelectionControllerAndNotifyIt();
208 if (touch_selection_controller_.get()) 210 if (touch_selection_controller_.get())
209 event->SetHandled(); 211 event->SetHandled();
210 } 212 }
211 return; 213 return;
212 case ui::ET_GESTURE_LONG_TAP: 214 case ui::ET_GESTURE_LONG_TAP:
213 if (!touch_selection_controller_.get()) 215 if (!touch_selection_controller_.get())
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 1431
1430 void NativeTextfieldViews::PlatformGestureEventHandling( 1432 void NativeTextfieldViews::PlatformGestureEventHandling(
1431 const ui::GestureEvent* event) { 1433 const ui::GestureEvent* event) {
1432 #if defined(OS_WIN) && defined(USE_AURA) 1434 #if defined(OS_WIN) && defined(USE_AURA)
1433 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only()) 1435 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only())
1434 base::win::DisplayVirtualKeyboard(); 1436 base::win::DisplayVirtualKeyboard();
1435 #endif 1437 #endif
1436 } 1438 }
1437 1439
1438 } // namespace views 1440 } // namespace views
OLDNEW
« no previous file with comments | « trunk/src/ui/ui.gyp ('k') | trunk/src/ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698