OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
11 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/platform_window/platform_window.h" | 13 #include "ui/platform_window/platform_window.h" |
14 #include "ui/platform_window/platform_window_delegate.h" | 14 #include "ui/platform_window/platform_window_delegate.h" |
15 | 15 |
16 namespace aura { | 16 namespace aura { |
17 | 17 |
18 // The unified WindowTreeHost implementation for platforms | 18 // The unified WindowTreeHost implementation for platforms |
19 // that implement PlatformWindow. | 19 // that implement PlatformWindow. |
20 class AURA_EXPORT WindowTreeHostPlatform | 20 class AURA_EXPORT WindowTreeHostPlatform |
21 : public WindowTreeHost, | 21 : public WindowTreeHost, |
22 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) { | 22 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) { |
23 public: | 23 public: |
24 explicit WindowTreeHostPlatform(const gfx::Rect& bounds); | 24 explicit WindowTreeHostPlatform(const gfx::Rect& bounds); |
25 ~WindowTreeHostPlatform() override; | 25 ~WindowTreeHostPlatform() override; |
26 | 26 |
| 27 #if defined(OS_ANDROID) |
| 28 // Returns the WindowTreeHostPlatform instance. |
| 29 static WindowTreeHostPlatform* GetHost(); |
| 30 #endif |
| 31 |
27 // WindowTreeHost: | 32 // WindowTreeHost: |
28 ui::EventSource* GetEventSource() override; | 33 ui::EventSource* GetEventSource() override; |
29 gfx::AcceleratedWidget GetAcceleratedWidget() override; | 34 gfx::AcceleratedWidget GetAcceleratedWidget() override; |
30 void ShowImpl() override; | 35 void ShowImpl() override; |
31 void HideImpl() override; | 36 void HideImpl() override; |
32 gfx::Rect GetBounds() const override; | 37 gfx::Rect GetBounds() const override; |
33 void SetBounds(const gfx::Rect& bounds) override; | 38 void SetBounds(const gfx::Rect& bounds) override; |
34 gfx::Point GetLocationOnNativeScreen() const override; | 39 gfx::Point GetLocationOnNativeScreen() const override; |
35 void SetCapture() override; | 40 void SetCapture() override; |
36 void ReleaseCapture() override; | 41 void ReleaseCapture() override; |
(...skipping 23 matching lines...) Expand all Loading... |
60 gfx::NativeCursor current_cursor_; | 65 gfx::NativeCursor current_cursor_; |
61 bool has_capture_; | 66 bool has_capture_; |
62 gfx::Rect bounds_; | 67 gfx::Rect bounds_; |
63 | 68 |
64 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostPlatform); | 69 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostPlatform); |
65 }; | 70 }; |
66 | 71 |
67 } // namespace aura | 72 } // namespace aura |
68 | 73 |
69 #endif // UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_ | 74 #endif // UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_ |
OLD | NEW |