Chromium Code Reviews| Index: ui/base/touch/touch_device_util.cc |
| diff --git a/ui/base/touch/touch_device_util.cc b/ui/base/touch/touch_device_util.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ee9229fb604dd48c5ef2c008b69174273c587c35 |
| --- /dev/null |
| +++ b/ui/base/touch/touch_device_util.cc |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/base/touch/touch_device.h" |
| + |
| +namespace ui { |
| + |
| +namespace { |
| + |
| +int available_pointer_types_for_testing = POINTER_TYPE_NONE; |
| +int available_hover_types_for_testing = HOVER_TYPE_NONE; |
| +bool return_available_pointer_and_hover_types_for_testing = false; |
| + |
| +} |
| + |
| +void SetAvailablePointerAndHoverTypesForTesting(int available_pointer_types, |
| + int available_hover_types) { |
| + return_available_pointer_and_hover_types_for_testing = true; |
| + available_pointer_types_for_testing = available_pointer_types; |
| + available_hover_types_for_testing = available_hover_types; |
| +} |
| + |
| +std::pair<int, int> GetAvailablePointerAndHoverTypes() { |
| + if (return_available_pointer_and_hover_types_for_testing) |
|
sadrul
2017/05/10 01:47:54
Indenting is off here
|
| + return std::make_pair(available_pointer_types_for_testing, |
| + available_hover_types_for_testing); |
| + return std::make_pair(GetAvailablePointerTypes(), GetAvailableHoverTypes()); |
| +} |
| + |
| +} // namespace ui |