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