summaryrefslogtreecommitdiffstats
path: root/components/mus/public/cpp/lib/window_tree_client_impl.cc
diff options
context:
space:
mode:
authorjonross <jonross@chromium.org>2016-03-08 06:03:26 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-08 14:04:36 +0000
commitc3385cc179280dd4b09733b2954be7e9ae3b5112 (patch)
treefcb8a119477033e1e18f3b8ca5b4bd0b0445b7ea /components/mus/public/cpp/lib/window_tree_client_impl.cc
parent1d3dd7dbbeea929087e089ae1e8acdaa4fae80aa (diff)
downloadchromium_src-c3385cc179280dd4b09733b2954be7e9ae3b5112.zip
chromium_src-c3385cc179280dd4b09733b2954be7e9ae3b5112.tar.gz
chromium_src-c3385cc179280dd4b09733b2954be7e9ae3b5112.tar.bz2
Update WindowTree::OnWindowInputEventAck to include handled
To support post-target accelerators we plan to have the client application report whether an input event was handled or not, when ack-ing the event. This change updates WindowTree::OnWindowInputEventAck to include a boolean parameter |handled|. PlatformWindowMus will always mark events as handled. CompositorMusConnection will base the handled state on the ack state of the renderer. TEST=WindowTreeClientImplTest, WindowTreeApptest, WindowTreeTest, CompositorMusConnectionTest BUG=560478 Review URL: https://codereview.chromium.org/1749323002 Cr-Commit-Position: refs/heads/master@{#379821}
Diffstat (limited to 'components/mus/public/cpp/lib/window_tree_client_impl.cc')
-rw-r--r--components/mus/public/cpp/lib/window_tree_client_impl.cc14
1 files changed, 9 insertions, 5 deletions
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 cdcd7b6..7c0a477 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) {