| 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_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_MOJO_H_ | 5 #ifndef MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_MOJO_H_ |
| 6 #define MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_MOJO_H_ | 6 #define MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_MOJO_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "mojo/public/cpp/bindings/remote_ptr.h" | |
| 10 #include "mojo/services/native_viewport/native_viewport.mojom.h" | 9 #include "mojo/services/native_viewport/native_viewport.mojom.h" |
| 11 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
| 12 #include "ui/events/event_source.h" | 11 #include "ui/events/event_source.h" |
| 13 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 14 | 13 |
| 15 namespace ui { | 14 namespace ui { |
| 16 class ContextFactory; | 15 class ContextFactory; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace mojo { | 18 namespace mojo { |
| 20 namespace examples { | 19 namespace examples { |
| 21 | 20 |
| 22 class WindowTreeHostMojo : public aura::WindowTreeHost, | 21 class WindowTreeHostMojo : public aura::WindowTreeHost, |
| 23 public ui::EventSource, | 22 public ui::EventSource, |
| 24 public NativeViewportClient { | 23 public NativeViewportClient { |
| 25 public: | 24 public: |
| 26 WindowTreeHostMojo(ScopedNativeViewportHandle viewport_handle, | 25 WindowTreeHostMojo(NativeViewportPtr viewport, |
| 27 const gfx::Rect& bounds, | 26 const gfx::Rect& bounds, |
| 28 const base::Callback<void()>& compositor_created_callback); | 27 const base::Callback<void()>& compositor_created_callback); |
| 29 virtual ~WindowTreeHostMojo(); | 28 virtual ~WindowTreeHostMojo(); |
| 30 | 29 |
| 31 gfx::Rect bounds() const { return bounds_; } | 30 gfx::Rect bounds() const { return bounds_; } |
| 32 ScopedMessagePipeHandle TakeGLES2PipeHandle() { return gles2_handle_.Pass(); } | 31 ScopedMessagePipeHandle TakeGLES2PipeHandle() { return gles2_handle_.Pass(); } |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 // WindowTreeHost: | 34 // WindowTreeHost: |
| 36 virtual ui::EventSource* GetEventSource() OVERRIDE; | 35 virtual ui::EventSource* GetEventSource() OVERRIDE; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 // Overridden from NativeViewportClient: | 53 // Overridden from NativeViewportClient: |
| 55 virtual void OnCreated() OVERRIDE; | 54 virtual void OnCreated() OVERRIDE; |
| 56 virtual void OnDestroyed() OVERRIDE; | 55 virtual void OnDestroyed() OVERRIDE; |
| 57 virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE; | 56 virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE; |
| 58 virtual void OnEvent(const Event& event, | 57 virtual void OnEvent(const Event& event, |
| 59 const mojo::Callback<void()>& callback) OVERRIDE; | 58 const mojo::Callback<void()>& callback) OVERRIDE; |
| 60 | 59 |
| 61 static ui::ContextFactory* context_factory_; | 60 static ui::ContextFactory* context_factory_; |
| 62 | 61 |
| 63 ScopedMessagePipeHandle gles2_handle_; | 62 ScopedMessagePipeHandle gles2_handle_; |
| 64 RemotePtr<NativeViewport> native_viewport_; | 63 NativeViewportPtr native_viewport_; |
| 65 base::Callback<void()> compositor_created_callback_; | 64 base::Callback<void()> compositor_created_callback_; |
| 66 | 65 |
| 67 gfx::Rect bounds_; | 66 gfx::Rect bounds_; |
| 68 | 67 |
| 69 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo); | 68 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo); |
| 70 }; | 69 }; |
| 71 | 70 |
| 72 } // namespace examples | 71 } // namespace examples |
| 73 } // namespace mojo | 72 } // namespace mojo |
| 74 | 73 |
| 75 #endif // MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_MOJO_H_ | 74 #endif // MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_MOJO_H_ |
| OLD | NEW |