OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ | 5 #ifndef UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ |
6 #define UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ | 6 #define UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // Used to track the number of times SetCursor() was called. | 25 // Used to track the number of times SetCursor() was called. |
26 int calls_to_set_cursor() const { return calls_to_set_cursor_; } | 26 int calls_to_set_cursor() const { return calls_to_set_cursor_; } |
27 void reset_calls_to_set_cursor() { calls_to_set_cursor_ = 0; } | 27 void reset_calls_to_set_cursor() { calls_to_set_cursor_ = 0; } |
28 | 28 |
29 // Set whether or not to hide cursor on key events. | 29 // Set whether or not to hide cursor on key events. |
30 void set_should_hide_cursor_on_key_event(bool hide) { | 30 void set_should_hide_cursor_on_key_event(bool hide) { |
31 should_hide_cursor_on_key_event_ = hide; | 31 should_hide_cursor_on_key_event_ = hide; |
32 } | 32 } |
33 | 33 |
34 // Overridden from aura::client::CursorClient: | 34 // Overridden from aura::client::CursorClient: |
35 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 35 virtual void SetCursor(gfx::NativeCursor cursor) override; |
36 virtual gfx::NativeCursor GetCursor() const OVERRIDE; | 36 virtual gfx::NativeCursor GetCursor() const override; |
37 virtual void ShowCursor() OVERRIDE; | 37 virtual void ShowCursor() override; |
38 virtual void HideCursor() OVERRIDE; | 38 virtual void HideCursor() override; |
39 virtual void SetCursorSet(ui::CursorSetType cursor_set) OVERRIDE; | 39 virtual void SetCursorSet(ui::CursorSetType cursor_set) override; |
40 virtual ui::CursorSetType GetCursorSet() const OVERRIDE; | 40 virtual ui::CursorSetType GetCursorSet() const override; |
41 virtual bool IsCursorVisible() const OVERRIDE; | 41 virtual bool IsCursorVisible() const override; |
42 virtual void EnableMouseEvents() OVERRIDE; | 42 virtual void EnableMouseEvents() override; |
43 virtual void DisableMouseEvents() OVERRIDE; | 43 virtual void DisableMouseEvents() override; |
44 virtual bool IsMouseEventsEnabled() const OVERRIDE; | 44 virtual bool IsMouseEventsEnabled() const override; |
45 virtual void SetDisplay(const gfx::Display& display) OVERRIDE; | 45 virtual void SetDisplay(const gfx::Display& display) override; |
46 virtual void LockCursor() OVERRIDE; | 46 virtual void LockCursor() override; |
47 virtual void UnlockCursor() OVERRIDE; | 47 virtual void UnlockCursor() override; |
48 virtual bool IsCursorLocked() const OVERRIDE; | 48 virtual bool IsCursorLocked() const override; |
49 virtual void AddObserver( | 49 virtual void AddObserver( |
50 aura::client::CursorClientObserver* observer) OVERRIDE; | 50 aura::client::CursorClientObserver* observer) override; |
51 virtual void RemoveObserver( | 51 virtual void RemoveObserver( |
52 aura::client::CursorClientObserver* observer) OVERRIDE; | 52 aura::client::CursorClientObserver* observer) override; |
53 virtual bool ShouldHideCursorOnKeyEvent( | 53 virtual bool ShouldHideCursorOnKeyEvent( |
54 const ui::KeyEvent& event) const OVERRIDE; | 54 const ui::KeyEvent& event) const override; |
55 | 55 |
56 private: | 56 private: |
57 bool visible_; | 57 bool visible_; |
58 bool should_hide_cursor_on_key_event_; | 58 bool should_hide_cursor_on_key_event_; |
59 bool mouse_events_enabled_; | 59 bool mouse_events_enabled_; |
60 int cursor_lock_count_; | 60 int cursor_lock_count_; |
61 int calls_to_set_cursor_; | 61 int calls_to_set_cursor_; |
62 ObserverList<aura::client::CursorClientObserver> observers_; | 62 ObserverList<aura::client::CursorClientObserver> observers_; |
63 aura::Window* root_window_; | 63 aura::Window* root_window_; |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(TestCursorClient); | 65 DISALLOW_COPY_AND_ASSIGN(TestCursorClient); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace test | 68 } // namespace test |
69 } // namespace aura | 69 } // namespace aura |
70 | 70 |
71 #endif // UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ | 71 #endif // UI_AURA_TEST_TEST_CURSOR_CLIENT_H_ |
OLD | NEW |