pointer_device_util.cc 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ui/base/pointer/pointer_device.h"
  5. namespace ui {
  6. namespace {
  7. int available_pointer_types_for_testing = POINTER_TYPE_NONE;
  8. int available_hover_types_for_testing = HOVER_TYPE_NONE;
  9. bool return_available_pointer_and_hover_types_for_testing = false;
  10. } // namespace
  11. void SetAvailablePointerAndHoverTypesForTesting(int available_pointer_types,
  12. int available_hover_types) {
  13. return_available_pointer_and_hover_types_for_testing = true;
  14. available_pointer_types_for_testing = available_pointer_types;
  15. available_hover_types_for_testing = available_hover_types;
  16. }
  17. std::pair<int, int> GetAvailablePointerAndHoverTypes() {
  18. if (return_available_pointer_and_hover_types_for_testing)
  19. return std::make_pair(available_pointer_types_for_testing,
  20. available_hover_types_for_testing);
  21. return std::make_pair(GetAvailablePointerTypes(), GetAvailableHoverTypes());
  22. }
  23. } // namespace ui