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 #include "ui/aura/test/test_cursor_client.h" | 5 #include "ui/aura/test/test_cursor_client.h" |
6 | 6 |
7 #include "ui/aura/client/cursor_client_observer.h" | 7 #include "ui/aura/client/cursor_client_observer.h" |
| 8 #include "ui/display/display.h" |
8 | 9 |
9 namespace aura { | 10 namespace aura { |
10 namespace test { | 11 namespace test { |
11 | 12 |
12 TestCursorClient::TestCursorClient(aura::Window* root_window) | 13 TestCursorClient::TestCursorClient(aura::Window* root_window) |
13 : visible_(true), | 14 : visible_(true), |
14 should_hide_cursor_on_key_event_(true), | 15 should_hide_cursor_on_key_event_(true), |
15 mouse_events_enabled_(true), | 16 mouse_events_enabled_(true), |
16 cursor_lock_count_(0), | 17 cursor_lock_count_(0), |
17 calls_to_set_cursor_(0), | 18 calls_to_set_cursor_(0), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void TestCursorClient::DisableMouseEvents() { | 62 void TestCursorClient::DisableMouseEvents() { |
62 mouse_events_enabled_ = false; | 63 mouse_events_enabled_ = false; |
63 } | 64 } |
64 | 65 |
65 bool TestCursorClient::IsMouseEventsEnabled() const { | 66 bool TestCursorClient::IsMouseEventsEnabled() const { |
66 return mouse_events_enabled_; | 67 return mouse_events_enabled_; |
67 } | 68 } |
68 | 69 |
69 void TestCursorClient::SetDisplay(const display::Display& display) {} | 70 void TestCursorClient::SetDisplay(const display::Display& display) {} |
70 | 71 |
| 72 const display::Display& TestCursorClient::GetDisplay() const { |
| 73 static const display::Display display; |
| 74 return display; |
| 75 } |
| 76 |
71 void TestCursorClient::LockCursor() { | 77 void TestCursorClient::LockCursor() { |
72 cursor_lock_count_++; | 78 cursor_lock_count_++; |
73 } | 79 } |
74 | 80 |
75 void TestCursorClient::UnlockCursor() { | 81 void TestCursorClient::UnlockCursor() { |
76 cursor_lock_count_--; | 82 cursor_lock_count_--; |
77 if (cursor_lock_count_ < 0) | 83 if (cursor_lock_count_ < 0) |
78 cursor_lock_count_ = 0; | 84 cursor_lock_count_ = 0; |
79 } | 85 } |
80 | 86 |
(...skipping 11 matching lines...) Expand all Loading... |
92 observers_.RemoveObserver(observer); | 98 observers_.RemoveObserver(observer); |
93 } | 99 } |
94 | 100 |
95 bool TestCursorClient::ShouldHideCursorOnKeyEvent( | 101 bool TestCursorClient::ShouldHideCursorOnKeyEvent( |
96 const ui::KeyEvent& event) const { | 102 const ui::KeyEvent& event) const { |
97 return should_hide_cursor_on_key_event_; | 103 return should_hide_cursor_on_key_event_; |
98 } | 104 } |
99 | 105 |
100 } // namespace test | 106 } // namespace test |
101 } // namespace aura | 107 } // namespace aura |
OLD | NEW |