Chromium Code Reviews| 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 #include <memory> | |
| 9 | |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" | 
| 11 #include "headless/lib/browser/headless_window_parenting_client.h" | |
| 9 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" | 
| 10 #include "ui/events/platform/platform_event_dispatcher.h" | 13 #include "ui/events/platform/platform_event_dispatcher.h" | 
| 11 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" | 
| 12 | 15 | 
| 13 namespace headless { | 16 namespace headless { | 
| 14 | 17 | 
| 15 class HeadlessWindowTreeHost : public aura::WindowTreeHost, | 18 class HeadlessWindowTreeHost : public aura::WindowTreeHost, | 
| 16 public ui::PlatformEventDispatcher { | 19 public ui::PlatformEventDispatcher { | 
| 17 public: | 20 public: | 
| 18 explicit HeadlessWindowTreeHost(const gfx::Rect& bounds); | 21 explicit HeadlessWindowTreeHost(const gfx::Rect& bounds); | 
| 19 ~HeadlessWindowTreeHost() override; | 22 ~HeadlessWindowTreeHost() override; | 
| 20 | 23 | 
| 24 gfx::NativeWindow NativeWindow(); | |
| 
 
Sami
2017/02/09 18:08:22
Not sure why we can't just use window()? This file
 
dvallet
2017/02/10 05:12:21
You are right, this came from an old refractoring.
 
 | |
| 25 void SetParentWindow(gfx::NativeWindow window); | |
| 26 gfx::NativeWindow GetTopWindowContainingPoint(const gfx::Point& point); | |
| 27 | |
| 21 // ui::PlatformEventDispatcher: | 28 // ui::PlatformEventDispatcher: | 
| 22 bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 29 bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 
| 23 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 30 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 
| 24 | 31 | 
| 25 // WindowTreeHost: | 32 // WindowTreeHost: | 
| 26 ui::EventSource* GetEventSource() override; | 33 ui::EventSource* GetEventSource() override; | 
| 27 gfx::AcceleratedWidget GetAcceleratedWidget() override; | 34 gfx::AcceleratedWidget GetAcceleratedWidget() override; | 
| 28 void ShowImpl() override; | 35 void ShowImpl() override; | 
| 29 void HideImpl() override; | 36 void HideImpl() override; | 
| 30 gfx::Rect GetBoundsInPixels() const override; | 37 gfx::Rect GetBoundsInPixels() const override; | 
| 31 void SetBoundsInPixels(const gfx::Rect& bounds) override; | 38 void SetBoundsInPixels(const gfx::Rect& bounds) override; | 
| 32 gfx::Point GetLocationOnScreenInPixels() const override; | 39 gfx::Point GetLocationOnScreenInPixels() const override; | 
| 33 void SetCapture() override; | 40 void SetCapture() override; | 
| 34 void ReleaseCapture() override; | 41 void ReleaseCapture() override; | 
| 35 void SetCursorNative(gfx::NativeCursor cursor_type) override; | 42 void SetCursorNative(gfx::NativeCursor cursor_type) override; | 
| 36 void MoveCursorToScreenLocationInPixels(const gfx::Point& location) override; | 43 void MoveCursorToScreenLocationInPixels(const gfx::Point& location) override; | 
| 37 void OnCursorVisibilityChangedNative(bool show) override; | 44 void OnCursorVisibilityChangedNative(bool show) override; | 
| 38 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; | 45 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; | 
| 39 | 46 | 
| 40 private: | 47 private: | 
| 41 gfx::Rect bounds_; | 48 gfx::Rect bounds_; | 
| 49 std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_; | |
| 42 | 50 | 
| 43 DISALLOW_COPY_AND_ASSIGN(HeadlessWindowTreeHost); | 51 DISALLOW_COPY_AND_ASSIGN(HeadlessWindowTreeHost); | 
| 44 }; | 52 }; | 
| 45 | 53 | 
| 46 } // namespace headless | 54 } // namespace headless | 
| 47 | 55 | 
| 48 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ | 56 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WINDOW_TREE_HOST_H_ | 
| OLD | NEW |