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

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

Issue 120503003: run aura_demo as a mojo app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_
6 #define MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_
7
8 #include "base/bind.h"
9 #include "mojo/public/bindings/lib/remote_ptr.h"
10 #include "mojom/native_viewport.h"
11 #include "ui/aura/window_tree_host.h"
12
13 namespace ui {
14 class ContextFactory;
15 }
16
17 namespace mojo {
18 namespace examples {
19
20 class GLES2ClientImpl;
21
22 class RootWindowHostMojo : public aura::RootWindowHost,
23 public NativeViewportClientStub {
24 public:
25 RootWindowHostMojo(ScopedMessagePipeHandle viewport_handle,
26 const base::Callback<void()>& compositor_created_callback);
27 virtual ~RootWindowHostMojo();
28
29 GLES2ClientImpl* gles2_client() { return gles2_client_.get(); }
30
31 private:
32 // RootWindowHost:
33 virtual aura::RootWindow* GetRootWindow() OVERRIDE;
34 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
35 virtual void Show() OVERRIDE;
36 virtual void Hide() OVERRIDE;
37 virtual void ToggleFullScreen() OVERRIDE;
38 virtual gfx::Rect GetBounds() const OVERRIDE;
39 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
40 virtual gfx::Insets GetInsets() const OVERRIDE;
41 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE;
42 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
43 virtual void SetCapture() OVERRIDE;
44 virtual void ReleaseCapture() OVERRIDE;
45 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
46 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE;
47 virtual bool ConfineCursorToRootWindow() OVERRIDE;
48 virtual void UnConfineCursor() OVERRIDE;
49 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE;
50 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
51 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
52 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
53 virtual void PrepareForShutdown() OVERRIDE;
54
55 // Overridden from NativeViewportClientStub:
56 virtual void OnCreated() OVERRIDE;
57 virtual void OnDestroyed() OVERRIDE;
58 virtual void OnEvent(const Event& event) OVERRIDE;
59
60 void DidCreateContext(gfx::Size size);
61
62 static ui::ContextFactory* context_factory_;
63
64 scoped_ptr<GLES2ClientImpl> gles2_client_;
65 RemotePtr<NativeViewport> native_viewport_;
66 base::Callback<void()> compositor_created_callback_;
67
68 DISALLOW_COPY_AND_ASSIGN(RootWindowHostMojo);
69 };
70
71 } // namespace examples
72 } // namespace mojo
73
74 #endif // MOJO_EXAMPLES_AURA_DEMO_ROOT_WINDOW_HOST_MOJO_H_
OLDNEW
« no previous file with comments | « mojo/examples/aura_demo/demo_screen.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