summaryrefslogtreecommitdiffstats
path: root/components/mus/ws
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/ws
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/ws')
-rw-r--r--components/mus/ws/window_tree.cc2
-rw-r--r--components/mus/ws/window_tree.h2
-rw-r--r--components/mus/ws/window_tree_apptest.cc2
-rw-r--r--components/mus/ws/window_tree_unittest.cc2
4 files changed, 4 insertions, 4 deletions
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 7782e8b..0356a8e 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -1145,7 +1145,7 @@ void WindowTree::SetImeVisibility(Id transport_window_id,
}
}
-void WindowTree::OnWindowInputEventAck(uint32_t event_id) {
+void WindowTree::OnWindowInputEventAck(uint32_t event_id, bool handled) {
if (event_ack_id_ == 0 || event_id != event_ack_id_) {
// TODO(sad): Something bad happened. Kill the client?
NOTIMPLEMENTED() << "Wrong event acked.";
diff --git a/components/mus/ws/window_tree.h b/components/mus/ws/window_tree.h
index 378186d..0c103e7 100644
--- a/components/mus/ws/window_tree.h
+++ b/components/mus/ws/window_tree.h
@@ -344,7 +344,7 @@ class WindowTree : public mojom::WindowTree,
void SetImeVisibility(Id transport_window_id,
bool visible,
mojo::TextInputStatePtr state) override;
- void OnWindowInputEventAck(uint32_t event_id) override;
+ void OnWindowInputEventAck(uint32_t event_id, bool handled) override;
void SetClientArea(
Id transport_window_id,
mojo::InsetsPtr insets,
diff --git a/components/mus/ws/window_tree_apptest.cc b/components/mus/ws/window_tree_apptest.cc
index 8970435..b143ab0 100644
--- a/components/mus/ws/window_tree_apptest.cc
+++ b/components/mus/ws/window_tree_apptest.cc
@@ -355,7 +355,7 @@ class TestWindowTreeClientImpl : public mojom::WindowTreeClient,
// Ack input events to clear the state on the server. These can be received
// during test startup. X11Window::DispatchEvent sends a synthetic move
// event to notify of entry.
- tree()->OnWindowInputEventAck(event_id);
+ tree()->OnWindowInputEventAck(event_id, true);
// Don't log input events as none of the tests care about them and they
// may come in at random points.
}
diff --git a/components/mus/ws/window_tree_unittest.cc b/components/mus/ws/window_tree_unittest.cc
index 17f59eb..99d88fe 100644
--- a/components/mus/ws/window_tree_unittest.cc
+++ b/components/mus/ws/window_tree_unittest.cc
@@ -198,7 +198,7 @@ class WindowTreeTest : public testing::Test {
void AckPreviousEvent() {
DisplayTestApi test_api(display_);
while (test_api.tree_awaiting_input_ack())
- test_api.tree_awaiting_input_ack()->OnWindowInputEventAck(0);
+ test_api.tree_awaiting_input_ack()->OnWindowInputEventAck(0, true);
}
void DispatchEventAndAckImmediately(const ui::Event& event) {