| 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" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/common/input/input_event_ack_state.h" |
| 12 #include "services/ui/public/cpp/input_event_handler.h" | 13 #include "services/ui/public/cpp/input_event_handler.h" |
| 13 #include "services/ui/public/cpp/window.h" | 14 #include "services/ui/public/cpp/window.h" |
| 14 #include "services/ui/public/cpp/window_tree_client.h" | 15 #include "services/ui/public/cpp/window_tree_client.h" |
| 15 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 16 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
| 16 #include "third_party/WebKit/public/web/WebInputEvent.h" | 17 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 18 #include "ui/events/blink/scoped_web_input_event.h" |
| 17 | 19 |
| 18 namespace ui { | 20 namespace ui { |
| 19 struct DidOverscrollParams; | 21 struct DidOverscrollParams; |
| 20 } | 22 } |
| 21 | 23 |
| 22 namespace content { | 24 namespace content { |
| 23 | 25 |
| 24 class InputHandlerManager; | 26 class InputHandlerManager; |
| 25 | 27 |
| 26 // CompositorMusConnection manages the connection to the Mandoline UI Service | 28 // CompositorMusConnection manages the connection to the Mandoline UI Service |
| (...skipping 28 matching lines...) Expand all Loading... |
| 55 | 57 |
| 56 void AttachSurfaceOnCompositorThread( | 58 void AttachSurfaceOnCompositorThread( |
| 57 std::unique_ptr<ui::WindowSurfaceBinding> surface_binding); | 59 std::unique_ptr<ui::WindowSurfaceBinding> surface_binding); |
| 58 | 60 |
| 59 void CreateWindowTreeClientOnCompositorThread( | 61 void CreateWindowTreeClientOnCompositorThread( |
| 60 ui::mojom::WindowTreeClientRequest request); | 62 ui::mojom::WindowTreeClientRequest request); |
| 61 | 63 |
| 62 void OnConnectionLostOnMainThread(); | 64 void OnConnectionLostOnMainThread(); |
| 63 | 65 |
| 64 void OnWindowInputEventOnMainThread( | 66 void OnWindowInputEventOnMainThread( |
| 65 std::unique_ptr<blink::WebInputEvent> web_event, | 67 ui::ScopedWebInputEvent web_event, |
| 66 const base::Callback<void(ui::mojom::EventResult)>& ack); | 68 const base::Callback<void(ui::mojom::EventResult)>& ack); |
| 67 | 69 |
| 68 void OnWindowInputEventAckOnMainThread( | 70 void OnWindowInputEventAckOnMainThread( |
| 69 const base::Callback<void(ui::mojom::EventResult)>& ack, | 71 const base::Callback<void(ui::mojom::EventResult)>& ack, |
| 70 ui::mojom::EventResult result); | 72 ui::mojom::EventResult result); |
| 71 | 73 |
| 72 // WindowTreeClientDelegate implementation: | 74 // WindowTreeClientDelegate implementation: |
| 73 void OnDidDestroyClient(ui::WindowTreeClient* client) override; | 75 void OnDidDestroyClient(ui::WindowTreeClient* client) override; |
| 74 void OnEmbed(ui::Window* root) override; | 76 void OnEmbed(ui::Window* root) override; |
| 75 void OnPointerEventObserved(const ui::PointerEvent& event, | 77 void OnPointerEventObserved(const ui::PointerEvent& event, |
| 76 ui::Window* target) override; | 78 ui::Window* target) override; |
| 77 | 79 |
| 78 // InputEventHandler implementation: | 80 // InputEventHandler implementation: |
| 79 void OnWindowInputEvent( | 81 void OnWindowInputEvent( |
| 80 ui::Window* window, | 82 ui::Window* window, |
| 81 const ui::Event& event, | 83 const ui::Event& event, |
| 82 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* | 84 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* |
| 83 ack_callback) override; | 85 ack_callback) override; |
| 86 void DidHandleWindowInputEventAndOverscroll( |
| 87 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>> |
| 88 ack_callback, |
| 89 InputEventAckState ack_state, |
| 90 ui::ScopedWebInputEvent web_event, |
| 91 const ui::LatencyInfo& latency_info, |
| 92 std::unique_ptr<ui::DidOverscrollParams>); |
| 84 | 93 |
| 85 const int routing_id_; | 94 const int routing_id_; |
| 86 ui::Window* root_; | 95 ui::Window* root_; |
| 87 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 96 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 88 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 97 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
| 89 InputHandlerManager* const input_handler_manager_; | 98 InputHandlerManager* const input_handler_manager_; |
| 90 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_; | 99 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_; |
| 91 | 100 |
| 92 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); | 101 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); |
| 93 }; | 102 }; |
| 94 | 103 |
| 95 } // namespace content | 104 } // namespace content |
| 96 | 105 |
| 97 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ | 106 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ |
| OLD | NEW |