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 #include "content/renderer/mus/compositor_mus_connection.h" | 5 #include "content/renderer/mus/compositor_mus_connection.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "content/common/input/web_input_event_traits.h" | 8 #include "content/common/input/web_input_event_traits.h" |
9 #include "content/renderer/input/input_handler_manager.h" | 9 #include "content/renderer/input/input_handler_manager.h" |
10 #include "content/renderer/mus/render_widget_mus_connection.h" | 10 #include "content/renderer/mus/render_widget_mus_connection.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void CompositorMusConnection::OnEmbed(ui::Window* root) { | 106 void CompositorMusConnection::OnEmbed(ui::Window* root) { |
107 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 107 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
108 root_ = root; | 108 root_ = root; |
109 root_->set_input_event_handler(this); | 109 root_->set_input_event_handler(this); |
110 if (window_surface_binding_) { | 110 if (window_surface_binding_) { |
111 root->AttachSurface(ui::mojom::SurfaceType::DEFAULT, | 111 root->AttachSurface(ui::mojom::SurfaceType::DEFAULT, |
112 std::move(window_surface_binding_)); | 112 std::move(window_surface_binding_)); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 void CompositorMusConnection::OnEventObserved(const ui::Event& event, | 116 void CompositorMusConnection::OnPointerWatcherEvent( |
117 ui::Window* target) { | 117 const ui::PointerEvent& event, |
118 // Compositor does not use SetEventObserver(). | 118 ui::Window* target) { |
| 119 // Compositor does not use StartPointerWatcher(). |
119 } | 120 } |
120 | 121 |
121 void CompositorMusConnection::OnWindowInputEvent( | 122 void CompositorMusConnection::OnWindowInputEvent( |
122 ui::Window* window, | 123 ui::Window* window, |
123 const ui::Event& event, | 124 const ui::Event& event, |
124 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { | 125 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { |
125 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 126 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
126 std::unique_ptr<blink::WebInputEvent> web_event( | 127 std::unique_ptr<blink::WebInputEvent> web_event( |
127 mojo::TypeConverter<std::unique_ptr<blink::WebInputEvent>, | 128 mojo::TypeConverter<std::unique_ptr<blink::WebInputEvent>, |
128 ui::Event>::Convert(event)); | 129 ui::Event>::Convert(event)); |
(...skipping 18 matching lines...) Expand all Loading... |
147 this, *ack_callback->get()); | 148 this, *ack_callback->get()); |
148 ack_callback->reset(); | 149 ack_callback->reset(); |
149 } | 150 } |
150 main_task_runner_->PostTask( | 151 main_task_runner_->PostTask( |
151 FROM_HERE, | 152 FROM_HERE, |
152 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, | 153 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, |
153 base::Passed(std::move(web_event)), ack)); | 154 base::Passed(std::move(web_event)), ack)); |
154 } | 155 } |
155 | 156 |
156 } // namespace content | 157 } // namespace content |
OLD | NEW |