Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: content/renderer/mus/compositor_mus_connection.cc

Issue 1921673005: mus: Add PointerWatcher for passively observing mouse and touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/mus/compositor_mus_connection.h ('k') | mash/wm/root_window_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void CompositorMusConnection::OnEmbed(mus::Window* root) { 109 void CompositorMusConnection::OnEmbed(mus::Window* root) {
110 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 110 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
111 root_ = root; 111 root_ = root;
112 root_->set_input_event_handler(this); 112 root_->set_input_event_handler(this);
113 if (window_surface_binding_) { 113 if (window_surface_binding_) {
114 root->AttachSurface(mus::mojom::SurfaceType::DEFAULT, 114 root->AttachSurface(mus::mojom::SurfaceType::DEFAULT,
115 std::move(window_surface_binding_)); 115 std::move(window_surface_binding_));
116 } 116 }
117 } 117 }
118 118
119 void CompositorMusConnection::OnEventObserved(const ui::Event& event) {
120 // Compositor does not use SetEventObserver().
121 }
122
119 void CompositorMusConnection::OnWindowInputEvent( 123 void CompositorMusConnection::OnWindowInputEvent(
120 mus::Window* window, 124 mus::Window* window,
121 const ui::Event& event, 125 const ui::Event& event,
122 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { 126 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) {
123 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 127 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
124 // TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent. 128 // TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent.
125 std::unique_ptr<blink::WebInputEvent> web_event( 129 std::unique_ptr<blink::WebInputEvent> web_event(
126 mus::mojom::Event::From(event) 130 mus::mojom::Event::From(event)
127 .To<std::unique_ptr<blink::WebInputEvent>>()); 131 .To<std::unique_ptr<blink::WebInputEvent>>());
128 // TODO(sad): We probably need to plumb LatencyInfo through Mus. 132 // TODO(sad): We probably need to plumb LatencyInfo through Mus.
(...skipping 17 matching lines...) Expand all
146 this, *ack_callback->get()); 150 this, *ack_callback->get());
147 ack_callback->reset(); 151 ack_callback->reset();
148 } 152 }
149 main_task_runner_->PostTask( 153 main_task_runner_->PostTask(
150 FROM_HERE, 154 FROM_HERE,
151 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, 155 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this,
152 base::Passed(std::move(web_event)), ack)); 156 base::Passed(std::move(web_event)), ack));
153 } 157 }
154 158
155 } // namespace content 159 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mus/compositor_mus_connection.h ('k') | mash/wm/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698