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

Side by Side Diff: ui/base/touch/touch_device_linux.cc

Issue 2673963002: Drop hover:on-demand support & let touch-screens report "none" instead. (Closed)
Patch Set: Fixed a "yikes!" Created 3 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
« no previous file with comments | « ui/base/touch/touch_device_android.cc ('k') | ui/base/touch/touch_device_win.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/base/touch/touch_device.h" 5 #include "ui/base/touch/touch_device.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/events/devices/input_device_manager.h" 8 #include "ui/events/devices/input_device_manager.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 10 matching lines...) Expand all
21 int available_pointer_types = POINTER_TYPE_FINE; 21 int available_pointer_types = POINTER_TYPE_FINE;
22 if (IsTouchDevicePresent()) 22 if (IsTouchDevicePresent())
23 available_pointer_types |= POINTER_TYPE_COARSE; 23 available_pointer_types |= POINTER_TYPE_COARSE;
24 24
25 DCHECK(available_pointer_types); 25 DCHECK(available_pointer_types);
26 return available_pointer_types; 26 return available_pointer_types;
27 } 27 }
28 28
29 // TODO(mustaq@chromium.org): Use mouse detection logic. crbug.com/495634 29 // TODO(mustaq@chromium.org): Use mouse detection logic. crbug.com/495634
30 int GetAvailableHoverTypes() { 30 int GetAvailableHoverTypes() {
31 // Assume a mouse is there
32 int available_hover_types = HOVER_TYPE_HOVER; 31 int available_hover_types = HOVER_TYPE_HOVER;
33 if (IsTouchDevicePresent()) 32 if (IsTouchDevicePresent())
34 available_hover_types |= HOVER_TYPE_ON_DEMAND; 33 available_hover_types |= HOVER_TYPE_NONE;
35
36 DCHECK(available_hover_types);
37 return available_hover_types; 34 return available_hover_types;
38 } 35 }
39 36
40 } // namespace 37 } // namespace
41 38
42 TouchScreensAvailability GetTouchScreensAvailability() { 39 TouchScreensAvailability GetTouchScreensAvailability() {
43 if (!IsTouchDevicePresent()) 40 if (!IsTouchDevicePresent())
44 return TouchScreensAvailability::NONE; 41 return TouchScreensAvailability::NONE;
45 42
46 return InputDeviceManager::GetInstance()->AreTouchscreensEnabled() 43 return InputDeviceManager::GetInstance()->AreTouchscreensEnabled()
(...skipping 21 matching lines...) Expand all
68 return POINTER_TYPE_FINE; 65 return POINTER_TYPE_FINE;
69 if (available_pointer_types & POINTER_TYPE_COARSE) 66 if (available_pointer_types & POINTER_TYPE_COARSE)
70 return POINTER_TYPE_COARSE; 67 return POINTER_TYPE_COARSE;
71 DCHECK_EQ(available_pointer_types, POINTER_TYPE_NONE); 68 DCHECK_EQ(available_pointer_types, POINTER_TYPE_NONE);
72 return POINTER_TYPE_NONE; 69 return POINTER_TYPE_NONE;
73 } 70 }
74 71
75 HoverType GetPrimaryHoverType(int available_hover_types) { 72 HoverType GetPrimaryHoverType(int available_hover_types) {
76 if (available_hover_types & HOVER_TYPE_HOVER) 73 if (available_hover_types & HOVER_TYPE_HOVER)
77 return HOVER_TYPE_HOVER; 74 return HOVER_TYPE_HOVER;
78 if (available_hover_types & HOVER_TYPE_ON_DEMAND)
79 return HOVER_TYPE_ON_DEMAND;
80 DCHECK_EQ(available_hover_types, HOVER_TYPE_NONE); 75 DCHECK_EQ(available_hover_types, HOVER_TYPE_NONE);
81 return HOVER_TYPE_NONE; 76 return HOVER_TYPE_NONE;
82 } 77 }
83 78
84 } // namespace ui 79 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/touch/touch_device_android.cc ('k') | ui/base/touch/touch_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698