| 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 | 8 |
| 9 namespace aura { | 9 namespace aura { |
| 10 namespace test { | 10 namespace test { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 void TestCursorClient::SetCursor(gfx::NativeCursor cursor) { | 26 void TestCursorClient::SetCursor(gfx::NativeCursor cursor) { |
| 27 calls_to_set_cursor_++; | 27 calls_to_set_cursor_++; |
| 28 } | 28 } |
| 29 | 29 |
| 30 gfx::NativeCursor TestCursorClient::GetCursor() const { | 30 gfx::NativeCursor TestCursorClient::GetCursor() const { |
| 31 return ui::kCursorNull; | 31 return ui::kCursorNull; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void TestCursorClient::ShowCursor() { | 34 void TestCursorClient::ShowCursor() { |
| 35 visible_ = true; | 35 visible_ = true; |
| 36 FOR_EACH_OBSERVER(aura::client::CursorClientObserver, observers_, | 36 for (aura::client::CursorClientObserver& observer : observers_) |
| 37 OnCursorVisibilityChanged(true)); | 37 observer.OnCursorVisibilityChanged(true); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void TestCursorClient::HideCursor() { | 40 void TestCursorClient::HideCursor() { |
| 41 visible_ = false; | 41 visible_ = false; |
| 42 FOR_EACH_OBSERVER(aura::client::CursorClientObserver, observers_, | 42 for (aura::client::CursorClientObserver& observer : observers_) |
| 43 OnCursorVisibilityChanged(false)); | 43 observer.OnCursorVisibilityChanged(false); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void TestCursorClient::SetCursorSet(ui::CursorSetType cursor_set) { | 46 void TestCursorClient::SetCursorSet(ui::CursorSetType cursor_set) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 ui::CursorSetType TestCursorClient::GetCursorSet() const { | 49 ui::CursorSetType TestCursorClient::GetCursorSet() const { |
| 50 return ui::CURSOR_SET_NORMAL; | 50 return ui::CURSOR_SET_NORMAL; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool TestCursorClient::IsCursorVisible() const { | 53 bool TestCursorClient::IsCursorVisible() const { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 observers_.RemoveObserver(observer); | 92 observers_.RemoveObserver(observer); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool TestCursorClient::ShouldHideCursorOnKeyEvent( | 95 bool TestCursorClient::ShouldHideCursorOnKeyEvent( |
| 96 const ui::KeyEvent& event) const { | 96 const ui::KeyEvent& event) const { |
| 97 return should_hide_cursor_on_key_event_; | 97 return should_hide_cursor_on_key_event_; |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace test | 100 } // namespace test |
| 101 } // namespace aura | 101 } // namespace aura |
| OLD | NEW |