Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: mojo/examples/aura_demo/root_window_host_mojo.h

Issue 109103003: Mojo: abstract interface implementation from generated Stub classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + fix build Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/examples/aura_demo/root_window_host_mojo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/examples/aura_demo/root_window_host_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698