1 // Copyright 2013 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 5 #ifndef UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ 6 #define UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ 7 8 #include "base/basictypes.h" 9 #include "base/compiler_specific.h" 10 #include "base/observer_list.h" 11 #include "ui/aura/client/cursor_client.h" 12 13 namespace aura { 14 namespace test { 15 16 class TestCursorClient : public aura::client::CursorClient { 17 public: 18 explicit TestCursorClient(aura::Window* root_window); 19 virtual ~TestCursorClient(); 20 21 // Overridden from aura::client::CursorClient: 22 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; 23 virtual gfx::NativeCursor GetCursor() const OVERRIDE; 24 virtual void ShowCursor() OVERRIDE; 25 virtual void HideCursor() OVERRIDE; 26 virtual void SetCursorSet(ui::CursorSetType cursor_set) OVERRIDE; 27 virtual ui::CursorSetType GetCursorSet() const OVERRIDE; 28 virtual void SetScale(float scale) OVERRIDE; 29 virtual float GetScale() const OVERRIDE; 30 virtual bool IsCursorVisible() const OVERRIDE; 31 virtual void EnableMouseEvents() OVERRIDE; 32 virtual void DisableMouseEvents() OVERRIDE; 33 virtual bool IsMouseEventsEnabled() const OVERRIDE; 34 virtual void SetDisplay(const gfx::Display& display) OVERRIDE; 35 virtual void LockCursor() OVERRIDE; 36 virtual void UnlockCursor() OVERRIDE; 37 virtual bool IsCursorLocked() const OVERRIDE; 38 virtual void AddObserver( 39 aura::client::CursorClientObserver* observer) OVERRIDE; 40 virtual void RemoveObserver( 41 aura::client::CursorClientObserver* observer) OVERRIDE; 42 43 private: 44 bool visible_; 45 bool mouse_events_enabled_; 46 int cursor_lock_count_; 47 ObserverList<aura::client::CursorClientObserver> observers_; 48 aura::Window* root_window_; 49 50 DISALLOW_COPY_AND_ASSIGN(TestCursorClient); 51 }; 52 53 } // namespace test 54 } // namespace aura 55 56 #endif // UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ 57