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

Unified Diff: components/mus/ws/window_manager_state.cc

Issue 1891413002: mash: Convert OnWindowInputEventAck to use an enum for handled status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a file Created 4 years, 8 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/ws/window_manager_state.h ('k') | components/mus/ws/window_manager_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_manager_state.cc
diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
index f383906af0ca6e47959ea7568b1b304f628edd27..c81bb8cb86b78b4d1ccfc2e6e0649a9e30cc96f3 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -160,7 +160,9 @@ void WindowManagerState::OnWillDestroyTree(WindowTree* tree) {
// The WindowTree is dying. So it's not going to ack the event.
// If the dying tree matches the root |tree_| marked as handled so we don't
// notify it of accelerators.
- OnEventAck(tree_awaiting_input_ack_, tree == tree_);
+ OnEventAck(tree_awaiting_input_ack_, tree == tree_
+ ? mojom::EventResult::HANDLED
+ : mojom::EventResult::UNHANDLED);
}
WindowManagerState::WindowManagerState(Display* display,
@@ -227,7 +229,8 @@ void WindowManagerState::ProcessEvent(const ui::Event& event) {
event_dispatcher_.ProcessEvent(event);
}
-void WindowManagerState::OnEventAck(mojom::WindowTree* tree, bool handled) {
+void WindowManagerState::OnEventAck(mojom::WindowTree* tree,
+ mojom::EventResult result) {
if (tree_awaiting_input_ack_ != tree) {
// TODO(sad): The ack must have arrived after the timeout. We should do
// something here, and in OnEventAckTimeout().
@@ -236,7 +239,7 @@ void WindowManagerState::OnEventAck(mojom::WindowTree* tree, bool handled) {
tree_awaiting_input_ack_ = nullptr;
event_ack_timer_.Stop();
- if (!handled && post_target_accelerator_)
+ if (result == mojom::EventResult::UNHANDLED && post_target_accelerator_)
OnAccelerator(post_target_accelerator_->id(), *event_awaiting_input_ack_);
ProcessNextEventFromQueue();
@@ -249,7 +252,7 @@ WindowServer* WindowManagerState::window_server() {
void WindowManagerState::OnEventAckTimeout() {
// TODO(sad): Figure out what we should do.
NOTIMPLEMENTED() << "Event ACK timed out.";
- OnEventAck(tree_awaiting_input_ack_, false);
+ OnEventAck(tree_awaiting_input_ack_, mojom::EventResult::UNHANDLED);
}
void WindowManagerState::QueueEvent(
« no previous file with comments | « components/mus/ws/window_manager_state.h ('k') | components/mus/ws/window_manager_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698