| 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..734c020a6f2734e15e46db5fa0357aac9ce2f68e
|
| --- /dev/null
|
| +++ b/ui/base/touch/touch_device_util.cc
|
| @@ -0,0 +1,30 @@
|
| +// 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)
|
| + return std::make_pair(available_pointer_types_for_testing,
|
| + available_hover_types_for_testing);
|
| + return std::make_pair(GetAvailablePointerTypes(), GetAvailableHoverTypes());
|
| +}
|
| +
|
| +} // namespace ui
|
|
|