testing_cursor_client_observer.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2016 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. #ifndef UI_WM_TEST_TESTING_CURSOR_CLIENT_OBSERVER_H_
  5. #define UI_WM_TEST_TESTING_CURSOR_CLIENT_OBSERVER_H_
  6. #include "ui/aura/client/cursor_client_observer.h"
  7. #include "ui/base/cursor/cursor_size.h"
  8. #include "ui/wm/core/cursor_manager.h"
  9. namespace wm {
  10. // CursorClientObserver for testing.
  11. class TestingCursorClientObserver : public aura::client::CursorClientObserver {
  12. public:
  13. TestingCursorClientObserver();
  14. TestingCursorClientObserver(const TestingCursorClientObserver&) = delete;
  15. TestingCursorClientObserver& operator=(const TestingCursorClientObserver&) =
  16. delete;
  17. void reset();
  18. bool is_cursor_visible() const { return cursor_visibility_; }
  19. bool did_visibility_change() const { return did_visibility_change_; }
  20. ui::CursorSize cursor_size() const { return cursor_size_; }
  21. bool did_cursor_size_change() const { return did_cursor_size_change_; }
  22. // Overridden from aura::client::CursorClientObserver:
  23. void OnCursorVisibilityChanged(bool is_visible) override;
  24. void OnCursorSizeChanged(ui::CursorSize cursor_size) override;
  25. private:
  26. bool cursor_visibility_;
  27. bool did_visibility_change_;
  28. ui::CursorSize cursor_size_;
  29. bool did_cursor_size_change_;
  30. };
  31. } // namespace wm
  32. #endif // UI_WM_TEST_TESTING_CURSOR_CLIENT_OBSERVER_H_