MD Downloads: prevent search text from overlapping with the cancel search (X)
[chromium-blink-merge.git] / ui / aura / test / aura_test_utils.cc
blobce40df855e89e107da40a3272a38db78094fb16c
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"
10 namespace aura {
11 namespace test {
13 class WindowTreeHostTestApi {
14 public:
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();
25 private:
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());
42 } // namespace test
43 } // namespace aura