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
3 // found in the LICENSE file.
5 #include "ui/aura/test/aura_test_utils.h"
7 #include "ui/aura/window_event_dispatcher.h"
8 #include "ui/aura/window_tree_host.h"
13 class WindowTreeHostTestApi
{
15 explicit WindowTreeHostTestApi(WindowTreeHost
* host
) : host_(host
) {}
17 const gfx::Point
& last_cursor_request_position_in_host() {
18 return host_
->last_cursor_request_position_in_host_
;
21 void set_dispatcher(scoped_ptr
<WindowEventDispatcher
> dispatcher
) {
22 host_
->dispatcher_
= dispatcher
.Pass();
26 WindowTreeHost
* host_
;
28 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi
);
31 const gfx::Point
& QueryLatestMousePositionRequestInHost(WindowTreeHost
* host
) {
32 WindowTreeHostTestApi
host_test_api(host
);
33 return host_test_api
.last_cursor_request_position_in_host();
36 void SetHostDispatcher(WindowTreeHost
* host
,
37 scoped_ptr
<WindowEventDispatcher
> dispatcher
) {
38 WindowTreeHostTestApi
host_test_api(host
);
39 host_test_api
.set_dispatcher(dispatcher
.Pass());