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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1749323002: Update WindowTree::OnWindowInputEventAck to include handled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing Component Build DEPS Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/public/cpp/input_event_handler.h ('k') | components/mus/public/cpp/tests/test_window_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/window_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index cdcd7b613a8670b7c973c2d8ac8c887086c01b92..7c0a47720fdccc7c9305a8101b70fc157a8dfb1a 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -820,17 +820,21 @@ void WindowTreeClientImpl::OnWindowInputEvent(uint32_t event_id,
mojom::EventPtr event) {
Window* window = GetWindowById(window_id);
if (!window || !window->input_event_handler_) {
- tree_->OnWindowInputEventAck(event_id);
+ tree_->OnWindowInputEventAck(event_id, false);
return;
}
- scoped_ptr<base::Closure> ack_callback(
- new base::Closure(base::Bind(&mojom::WindowTree::OnWindowInputEventAck,
- base::Unretained(tree_), event_id)));
+ scoped_ptr<base::Callback<void(bool)>> ack_callback(
+ new base::Callback<void(bool)>(
+ base::Bind(&mojom::WindowTree::OnWindowInputEventAck,
+ base::Unretained(tree_), event_id)));
window->input_event_handler_->OnWindowInputEvent(window, std::move(event),
&ack_callback);
+
+ // The handler did not take ownership of the callback, so we send the ack,
+ // marking the event as not consumed.
if (ack_callback)
- ack_callback->Run();
+ ack_callback->Run(false);
}
void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) {
« no previous file with comments | « components/mus/public/cpp/input_event_handler.h ('k') | components/mus/public/cpp/tests/test_window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698