| 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/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 "base/win/win_util.h" | 8 #include "base/win/win_util.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return POINTER_TYPE_NONE; | 90 return POINTER_TYPE_NONE; |
| 91 } | 91 } |
| 92 | 92 |
| 93 HoverType GetPrimaryHoverType(int available_hover_types) { | 93 HoverType GetPrimaryHoverType(int available_hover_types) { |
| 94 if (available_hover_types & HOVER_TYPE_HOVER) | 94 if (available_hover_types & HOVER_TYPE_HOVER) |
| 95 return HOVER_TYPE_HOVER; | 95 return HOVER_TYPE_HOVER; |
| 96 DCHECK_EQ(available_hover_types, HOVER_TYPE_NONE); | 96 DCHECK_EQ(available_hover_types, HOVER_TYPE_NONE); |
| 97 return HOVER_TYPE_NONE; | 97 return HOVER_TYPE_NONE; |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool return_available_pointer_and_hover_types_for_testing = false; |
| 101 int available_pointer_types_for_testing = POINTER_TYPE_NONE; |
| 102 int available_hover_types_for_testing = HOVER_TYPE_NONE; |
| 103 |
| 104 void SetAvailablePointerAndHoverTypesForTesting(int available_pointer_types, |
| 105 int available_hover_types) { |
| 106 return_available_pointer_and_hover_types_for_testing = true; |
| 107 available_pointer_types_for_testing = available_pointer_types; |
| 108 available_hover_types_for_testing = available_hover_types; |
| 109 } |
| 110 |
| 100 std::pair<int, int> GetAvailablePointerAndHoverTypes() { | 111 std::pair<int, int> GetAvailablePointerAndHoverTypes() { |
| 112 if (return_available_pointer_and_hover_types_for_testing) |
| 113 return std::make_pair(available_pointer_types_for_testing, |
| 114 available_hover_types_for_testing); |
| 101 return std::make_pair(GetAvailablePointerTypes(), GetAvailableHoverTypes()); | 115 return std::make_pair(GetAvailablePointerTypes(), GetAvailableHoverTypes()); |
| 102 } | 116 } |
| 103 | 117 |
| 104 } // namespace ui | 118 } // namespace ui |
| OLD | NEW |