| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ | 5 #ifndef CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ |
| 6 #define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ | 6 #define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/mus/public/cpp/input_event_handler.h" | 10 #include "components/mus/public/cpp/input_event_handler.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 35 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
| 36 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request, | 36 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request, |
| 37 InputHandlerManager* input_handler_manager); | 37 InputHandlerManager* input_handler_manager); |
| 38 | 38 |
| 39 // Attaches the provided |surface_binding| with the mus::Window for the | 39 // Attaches the provided |surface_binding| with the mus::Window for the |
| 40 // renderer once it becomes available. | 40 // renderer once it becomes available. |
| 41 void AttachSurfaceOnMainThread( | 41 void AttachSurfaceOnMainThread( |
| 42 scoped_ptr<mus::WindowSurfaceBinding> surface_binding); | 42 scoped_ptr<mus::WindowSurfaceBinding> surface_binding); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 friend class CompositorMusConnectionTest; |
| 45 friend class base::RefCountedThreadSafe<CompositorMusConnection>; | 46 friend class base::RefCountedThreadSafe<CompositorMusConnection>; |
| 46 | 47 |
| 47 ~CompositorMusConnection() override; | 48 ~CompositorMusConnection() override; |
| 48 | 49 |
| 49 void AttachSurfaceOnCompositorThread( | 50 void AttachSurfaceOnCompositorThread( |
| 50 scoped_ptr<mus::WindowSurfaceBinding> surface_binding); | 51 scoped_ptr<mus::WindowSurfaceBinding> surface_binding); |
| 51 | 52 |
| 52 void CreateWindowTreeConnectionOnCompositorThread( | 53 void CreateWindowTreeConnectionOnCompositorThread( |
| 53 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request); | 54 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request); |
| 54 | 55 |
| 55 void OnConnectionLostOnMainThread(); | 56 void OnConnectionLostOnMainThread(); |
| 56 | 57 |
| 57 void OnWindowInputEventOnMainThread( | 58 void OnWindowInputEventOnMainThread( |
| 58 scoped_ptr<blink::WebInputEvent> web_event, | 59 scoped_ptr<blink::WebInputEvent> web_event, |
| 59 const base::Closure& ack); | 60 const base::Callback<void(bool)>& ack); |
| 60 | 61 |
| 61 void OnWindowInputEventAckOnMainThread(const base::Closure& ack); | 62 void OnWindowInputEventAckOnMainThread(const base::Callback<void(bool)>& ack, |
| 63 bool handled); |
| 62 | 64 |
| 63 // WindowTreeDelegate implementation: | 65 // WindowTreeDelegate implementation: |
| 64 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 66 void OnConnectionLost(mus::WindowTreeConnection* connection) override; |
| 65 void OnEmbed(mus::Window* root) override; | 67 void OnEmbed(mus::Window* root) override; |
| 66 | 68 |
| 67 // InputEventHandler implementation: | 69 // InputEventHandler implementation: |
| 68 void OnWindowInputEvent(mus::Window* window, | 70 void OnWindowInputEvent( |
| 69 mus::mojom::EventPtr event, | 71 mus::Window* window, |
| 70 scoped_ptr<base::Closure>* ack_callback) override; | 72 mus::mojom::EventPtr event, |
| 73 scoped_ptr<base::Callback<void(bool)>>* ack_callback) override; |
| 71 | 74 |
| 72 const int routing_id_; | 75 const int routing_id_; |
| 73 mus::Window* root_; | 76 mus::Window* root_; |
| 74 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 75 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 78 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
| 76 InputHandlerManager* const input_handler_manager_; | 79 InputHandlerManager* const input_handler_manager_; |
| 77 scoped_ptr<mus::WindowSurfaceBinding> window_surface_binding_; | 80 scoped_ptr<mus::WindowSurfaceBinding> window_surface_binding_; |
| 78 | 81 |
| 79 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); | 82 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); |
| 80 }; | 83 }; |
| 81 | 84 |
| 82 } // namespace content | 85 } // namespace content |
| 83 | 86 |
| 84 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ | 87 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ |
| OLD | NEW |