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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/common/input/input_event_ack_state.h" |
15 #include "services/ui/public/cpp/input_event_handler.h" | 16 #include "services/ui/public/cpp/input_event_handler.h" |
16 #include "services/ui/public/cpp/window.h" | 17 #include "services/ui/public/cpp/window.h" |
17 #include "services/ui/public/cpp/window_tree_client.h" | 18 #include "services/ui/public/cpp/window_tree_client.h" |
18 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 19 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
19 #include "third_party/WebKit/public/web/WebInputEvent.h" | 20 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 21 #include "ui/events/blink/scoped_web_input_event.h" |
20 #include "ui/events/gestures/motion_event_aura.h" | 22 #include "ui/events/gestures/motion_event_aura.h" |
21 | 23 |
22 namespace ui { | 24 namespace ui { |
23 struct DidOverscrollParams; | 25 struct DidOverscrollParams; |
24 } | 26 } |
25 | 27 |
26 namespace content { | 28 namespace content { |
27 | 29 |
28 class InputHandlerManager; | 30 class InputHandlerManager; |
29 | 31 |
(...skipping 29 matching lines...) Expand all Loading... |
59 | 61 |
60 void AttachSurfaceOnCompositorThread( | 62 void AttachSurfaceOnCompositorThread( |
61 std::unique_ptr<ui::WindowSurfaceBinding> surface_binding); | 63 std::unique_ptr<ui::WindowSurfaceBinding> surface_binding); |
62 | 64 |
63 void CreateWindowTreeClientOnCompositorThread( | 65 void CreateWindowTreeClientOnCompositorThread( |
64 ui::mojom::WindowTreeClientRequest request); | 66 ui::mojom::WindowTreeClientRequest request); |
65 | 67 |
66 void OnConnectionLostOnMainThread(); | 68 void OnConnectionLostOnMainThread(); |
67 | 69 |
68 void OnWindowInputEventOnMainThread( | 70 void OnWindowInputEventOnMainThread( |
69 std::unique_ptr<blink::WebInputEvent> web_event, | 71 ui::ScopedWebInputEvent web_event, |
70 const base::Callback<void(ui::mojom::EventResult)>& ack); | 72 const base::Callback<void(ui::mojom::EventResult)>& ack); |
71 | 73 |
72 void OnWindowInputEventAckOnMainThread( | 74 void OnWindowInputEventAckOnMainThread( |
73 const base::Callback<void(ui::mojom::EventResult)>& ack, | 75 const base::Callback<void(ui::mojom::EventResult)>& ack, |
74 ui::mojom::EventResult result); | 76 ui::mojom::EventResult result); |
75 | 77 |
76 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event); | 78 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event); |
77 | 79 |
78 void DeleteWindowTreeClient(); | 80 void DeleteWindowTreeClient(); |
79 | 81 |
80 // WindowTreeClientDelegate implementation: | 82 // WindowTreeClientDelegate implementation: |
81 void OnEmbed(ui::Window* root) override; | 83 void OnEmbed(ui::Window* root) override; |
82 void OnEmbedRootDestroyed(ui::Window* root) override; | 84 void OnEmbedRootDestroyed(ui::Window* root) override; |
83 void OnLostConnection(ui::WindowTreeClient* client) override; | 85 void OnLostConnection(ui::WindowTreeClient* client) override; |
84 void OnPointerEventObserved(const ui::PointerEvent& event, | 86 void OnPointerEventObserved(const ui::PointerEvent& event, |
85 ui::Window* target) override; | 87 ui::Window* target) override; |
86 | 88 |
87 // InputEventHandler implementation: | 89 // InputEventHandler implementation: |
88 void OnWindowInputEvent( | 90 void OnWindowInputEvent( |
89 ui::Window* window, | 91 ui::Window* window, |
90 const ui::Event& event, | 92 const ui::Event& event, |
91 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* | 93 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* |
92 ack_callback) override; | 94 ack_callback) override; |
| 95 void DidHandleWindowInputEventAndOverscroll( |
| 96 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>> |
| 97 ack_callback, |
| 98 InputEventAckState ack_state, |
| 99 ui::ScopedWebInputEvent web_event, |
| 100 const ui::LatencyInfo& latency_info, |
| 101 std::unique_ptr<ui::DidOverscrollParams> overscroll_params); |
93 | 102 |
94 const int routing_id_; | 103 const int routing_id_; |
95 // Use this lock when accessing |window_tree_client_|. Lock exists solely for | 104 // Use this lock when accessing |window_tree_client_|. Lock exists solely for |
96 // DCHECK in destructor. | 105 // DCHECK in destructor. |
97 base::Lock window_tree_client_lock_; | 106 base::Lock window_tree_client_lock_; |
98 std::unique_ptr<ui::WindowTreeClient> window_tree_client_; | 107 std::unique_ptr<ui::WindowTreeClient> window_tree_client_; |
99 ui::Window* root_; | 108 ui::Window* root_; |
100 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 109 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
101 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 110 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
102 InputHandlerManager* const input_handler_manager_; | 111 InputHandlerManager* const input_handler_manager_; |
103 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_; | 112 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_; |
104 | 113 |
105 // Stores the current state of the active pointers targeting this object. | 114 // Stores the current state of the active pointers targeting this object. |
106 ui::MotionEventAura pointer_state_; | 115 ui::MotionEventAura pointer_state_; |
107 | 116 |
108 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); | 117 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); |
109 }; | 118 }; |
110 | 119 |
111 } // namespace content | 120 } // namespace content |
112 | 121 |
113 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ | 122 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ |
OLD | NEW |