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_ROOT_WINDOW_HOST_MOJO_H_ | 5 #ifndef MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_ |
6 #define MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_ | 6 #define MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "mojo/public/bindings/lib/remote_ptr.h" | 9 #include "mojo/public/bindings/lib/remote_ptr.h" |
10 #include "mojom/native_viewport.h" | 10 #include "mojom/native_viewport.h" |
11 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 class ContextFactory; | 14 class ContextFactory; |
15 } | 15 } |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace examples { | 18 namespace examples { |
19 | 19 |
20 class GLES2ClientImpl; | 20 class GLES2ClientImpl; |
21 | 21 |
22 class RootWindowHostMojo : public aura::RootWindowHost, | 22 class RootWindowHostMojo : public aura::RootWindowHost, |
23 public NativeViewportClientStub { | 23 public NativeViewportClient { |
24 public: | 24 public: |
25 RootWindowHostMojo(ScopedMessagePipeHandle viewport_handle, | 25 RootWindowHostMojo(ScopedMessagePipeHandle viewport_handle, |
26 const base::Callback<void()>& compositor_created_callback); | 26 const base::Callback<void()>& compositor_created_callback); |
27 virtual ~RootWindowHostMojo(); | 27 virtual ~RootWindowHostMojo(); |
28 | 28 |
29 GLES2ClientImpl* gles2_client() { return gles2_client_.get(); } | 29 GLES2ClientImpl* gles2_client() { return gles2_client_.get(); } |
30 | 30 |
31 private: | 31 private: |
32 // RootWindowHost: | 32 // RootWindowHost: |
33 virtual aura::RootWindow* GetRootWindow() OVERRIDE; | 33 virtual aura::RootWindow* GetRootWindow() OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
45 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 45 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
46 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; | 46 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; |
47 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 47 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
48 virtual void UnConfineCursor() OVERRIDE; | 48 virtual void UnConfineCursor() OVERRIDE; |
49 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; | 49 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; |
50 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 50 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
51 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 51 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
52 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 52 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
53 virtual void PrepareForShutdown() OVERRIDE; | 53 virtual void PrepareForShutdown() OVERRIDE; |
54 | 54 |
55 // Overridden from NativeViewportClientStub: | 55 // Overridden from NativeViewportClient: |
56 virtual void OnCreated() OVERRIDE; | 56 virtual void OnCreated() OVERRIDE; |
57 virtual void OnDestroyed() OVERRIDE; | 57 virtual void OnDestroyed() OVERRIDE; |
58 virtual void OnEvent(const Event& event) OVERRIDE; | 58 virtual void OnEvent(const Event& event) OVERRIDE; |
59 | 59 |
60 void DidCreateContext(gfx::Size size); | 60 void DidCreateContext(gfx::Size size); |
61 | 61 |
62 static ui::ContextFactory* context_factory_; | 62 static ui::ContextFactory* context_factory_; |
63 | 63 |
64 scoped_ptr<GLES2ClientImpl> gles2_client_; | 64 scoped_ptr<GLES2ClientImpl> gles2_client_; |
65 RemotePtr<NativeViewport> native_viewport_; | 65 RemotePtr<NativeViewport> native_viewport_; |
66 base::Callback<void()> compositor_created_callback_; | 66 base::Callback<void()> compositor_created_callback_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(RootWindowHostMojo); | 68 DISALLOW_COPY_AND_ASSIGN(RootWindowHostMojo); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace examples | 71 } // namespace examples |
72 } // namespace mojo | 72 } // namespace mojo |
73 | 73 |
74 #endif // MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_ | 74 #endif // MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_ |
OLD | NEW |