OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 MOJO_AURA_WINDOW_TREE_HOST_MOJO_H_ | 5 #ifndef MOJO_AURA_WINDOW_TREE_HOST_MOJO_H_ |
6 #define MOJO_AURA_WINDOW_TREE_HOST_MOJO_H_ | 6 #define MOJO_AURA_WINDOW_TREE_HOST_MOJO_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "mojo/services/native_viewport/native_viewport.mojom.h" | 9 #include "mojo/services/native_viewport/native_viewport.mojom.h" |
10 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
11 #include "ui/events/event_source.h" | 11 #include "ui/events/event_source.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 class ContextFactory; | 15 class ContextFactory; |
16 } | 16 } |
17 | 17 |
18 namespace mojo { | 18 namespace mojo { |
| 19 namespace view_manager { |
| 20 namespace service { |
19 | 21 |
20 class ContextFactoryMojo; | 22 class ContextFactoryImpl; |
21 | 23 |
22 class WindowTreeHostMojo : public aura::WindowTreeHost, | 24 class WindowTreeHostImpl : public aura::WindowTreeHost, |
23 public ui::EventSource, | 25 public ui::EventSource, |
24 public NativeViewportClient { | 26 public NativeViewportClient { |
25 public: | 27 public: |
26 WindowTreeHostMojo(NativeViewportPtr viewport, | 28 WindowTreeHostImpl(NativeViewportPtr viewport, |
27 const gfx::Rect& bounds, | 29 const gfx::Rect& bounds, |
28 const base::Callback<void()>& compositor_created_callback); | 30 const base::Callback<void()>& compositor_created_callback); |
29 virtual ~WindowTreeHostMojo(); | 31 virtual ~WindowTreeHostImpl(); |
30 | 32 |
31 gfx::Rect bounds() const { return bounds_; } | 33 gfx::Rect bounds() const { return bounds_; } |
32 | 34 |
33 private: | 35 private: |
34 // WindowTreeHost: | 36 // WindowTreeHost: |
35 virtual ui::EventSource* GetEventSource() OVERRIDE; | 37 virtual ui::EventSource* GetEventSource() OVERRIDE; |
36 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 38 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
37 virtual void Show() OVERRIDE; | 39 virtual void Show() OVERRIDE; |
38 virtual void Hide() OVERRIDE; | 40 virtual void Hide() OVERRIDE; |
39 virtual gfx::Rect GetBounds() const OVERRIDE; | 41 virtual gfx::Rect GetBounds() const OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
50 // ui::EventSource: | 52 // ui::EventSource: |
51 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; | 53 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; |
52 | 54 |
53 // Overridden from NativeViewportClient: | 55 // Overridden from NativeViewportClient: |
54 virtual void OnCreated() OVERRIDE; | 56 virtual void OnCreated() OVERRIDE; |
55 virtual void OnDestroyed() OVERRIDE; | 57 virtual void OnDestroyed() OVERRIDE; |
56 virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE; | 58 virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE; |
57 virtual void OnEvent(EventPtr event, | 59 virtual void OnEvent(EventPtr event, |
58 const mojo::Callback<void()>& callback) OVERRIDE; | 60 const mojo::Callback<void()>& callback) OVERRIDE; |
59 | 61 |
60 static ContextFactoryMojo* context_factory_; | 62 static ContextFactoryImpl* context_factory_; |
61 | 63 |
62 NativeViewportPtr native_viewport_; | 64 NativeViewportPtr native_viewport_; |
63 base::Callback<void()> compositor_created_callback_; | 65 base::Callback<void()> compositor_created_callback_; |
64 | 66 |
65 gfx::Rect bounds_; | 67 gfx::Rect bounds_; |
66 | 68 |
67 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo); | 69 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); |
68 }; | 70 }; |
69 | 71 |
| 72 } // namespace service |
| 73 } // namespace view_manager |
70 } // namespace mojo | 74 } // namespace mojo |
71 | 75 |
72 #endif // MOJO_AURA_WINDOW_TREE_HOST_MOJO_H_ | 76 #endif // MOJO_AURA_WINDOW_TREE_HOST_MOJO_H_ |
OLD | NEW |