OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ |
7 | 7 |
8 #if defined(USE_AURA) | |
9 | |
10 #include <memory> | 8 #include <memory> |
11 | 9 |
12 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "headless/lib/browser/headless_window_parenting_client.h" |
13 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
14 #include "ui/events/platform/platform_event_dispatcher.h" | 13 #include "ui/events/platform/platform_event_dispatcher.h" |
15 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
16 | 15 |
17 namespace aura { | |
18 namespace client { | |
19 class FocusClient; | |
20 class WindowParentingClient; | |
21 } | |
22 } | |
23 | |
24 namespace headless { | 16 namespace headless { |
25 | 17 |
26 class HeadlessWindowTreeHost : public aura::WindowTreeHost, | 18 class HeadlessWindowTreeHost : public aura::WindowTreeHost, |
27 public ui::PlatformEventDispatcher { | 19 public ui::PlatformEventDispatcher { |
28 public: | 20 public: |
29 explicit HeadlessWindowTreeHost(const gfx::Rect& bounds); | 21 explicit HeadlessWindowTreeHost(const gfx::Rect& bounds); |
30 ~HeadlessWindowTreeHost() override; | 22 ~HeadlessWindowTreeHost() override; |
31 | 23 |
32 void SetParentWindow(gfx::NativeWindow window); | 24 void SetParentWindow(gfx::NativeWindow window); |
33 | 25 |
(...skipping 11 matching lines...) Expand all Loading... |
45 gfx::Point GetLocationOnScreenInPixels() const override; | 37 gfx::Point GetLocationOnScreenInPixels() const override; |
46 void SetCapture() override; | 38 void SetCapture() override; |
47 void ReleaseCapture() override; | 39 void ReleaseCapture() override; |
48 void SetCursorNative(gfx::NativeCursor cursor_type) override; | 40 void SetCursorNative(gfx::NativeCursor cursor_type) override; |
49 void MoveCursorToScreenLocationInPixels(const gfx::Point& location) override; | 41 void MoveCursorToScreenLocationInPixels(const gfx::Point& location) override; |
50 void OnCursorVisibilityChangedNative(bool show) override; | 42 void OnCursorVisibilityChangedNative(bool show) override; |
51 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; | 43 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; |
52 | 44 |
53 private: | 45 private: |
54 gfx::Rect bounds_; | 46 gfx::Rect bounds_; |
55 std::unique_ptr<aura::client::FocusClient> focus_client_; | |
56 std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_; | 47 std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_; |
57 | 48 |
58 DISALLOW_COPY_AND_ASSIGN(HeadlessWindowTreeHost); | 49 DISALLOW_COPY_AND_ASSIGN(HeadlessWindowTreeHost); |
59 }; | 50 }; |
60 | 51 |
61 } // namespace headless | 52 } // namespace headless |
62 | 53 |
63 #else // defined(USE_AURA) | |
64 class HeadlessWindowTreeHost {}; | |
65 #endif // defined(USE_AURA) | |
66 | |
67 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ | 54 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ |
OLD | NEW |