OLD | NEW |
(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_ |
OLD | NEW |