| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/aura_test_utils.h" | 5 #include "ui/aura/test/aura_test_utils.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
| 8 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
| 9 | 11 |
| 10 namespace aura { | 12 namespace aura { |
| 11 namespace test { | 13 namespace test { |
| 12 | 14 |
| 13 class WindowTreeHostTestApi { | 15 class WindowTreeHostTestApi { |
| 14 public: | 16 public: |
| 15 explicit WindowTreeHostTestApi(WindowTreeHost* host) : host_(host) {} | 17 explicit WindowTreeHostTestApi(WindowTreeHost* host) : host_(host) {} |
| 16 | 18 |
| 17 const gfx::Point& last_cursor_request_position_in_host() { | 19 const gfx::Point& last_cursor_request_position_in_host() { |
| 18 return host_->last_cursor_request_position_in_host_; | 20 return host_->last_cursor_request_position_in_host_; |
| 19 } | 21 } |
| 20 | 22 |
| 21 void set_dispatcher(scoped_ptr<WindowEventDispatcher> dispatcher) { | 23 void set_dispatcher(scoped_ptr<WindowEventDispatcher> dispatcher) { |
| 22 host_->dispatcher_ = dispatcher.Pass(); | 24 host_->dispatcher_ = std::move(dispatcher); |
| 23 } | 25 } |
| 24 | 26 |
| 25 private: | 27 private: |
| 26 WindowTreeHost* host_; | 28 WindowTreeHost* host_; |
| 27 | 29 |
| 28 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi); | 30 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi); |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 const gfx::Point& QueryLatestMousePositionRequestInHost(WindowTreeHost* host) { | 33 const gfx::Point& QueryLatestMousePositionRequestInHost(WindowTreeHost* host) { |
| 32 WindowTreeHostTestApi host_test_api(host); | 34 WindowTreeHostTestApi host_test_api(host); |
| 33 return host_test_api.last_cursor_request_position_in_host(); | 35 return host_test_api.last_cursor_request_position_in_host(); |
| 34 } | 36 } |
| 35 | 37 |
| 36 void SetHostDispatcher(WindowTreeHost* host, | 38 void SetHostDispatcher(WindowTreeHost* host, |
| 37 scoped_ptr<WindowEventDispatcher> dispatcher) { | 39 scoped_ptr<WindowEventDispatcher> dispatcher) { |
| 38 WindowTreeHostTestApi host_test_api(host); | 40 WindowTreeHostTestApi host_test_api(host); |
| 39 host_test_api.set_dispatcher(dispatcher.Pass()); | 41 host_test_api.set_dispatcher(std::move(dispatcher)); |
| 40 } | 42 } |
| 41 | 43 |
| 42 } // namespace test | 44 } // namespace test |
| 43 } // namespace aura | 45 } // namespace aura |
| OLD | NEW |