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