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

Unified Diff: services/ui/ws/window_manager_state.cc

Issue 2761233003: Adds ability for accelerators to add key/value pairs to KeyEvent (Closed)
Patch Set: feedback and compile Created 3 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 | « services/ui/ws/window_manager_state.h ('k') | services/ui/ws/window_manager_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_manager_state.cc
diff --git a/services/ui/ws/window_manager_state.cc b/services/ui/ws/window_manager_state.cc
index d9b9ed52c760fc9feb2932ce2b94462aeabe3a55..4b03ed4f4499ea14526285a6db1e2258660cc1af 100644
--- a/services/ui/ws/window_manager_state.cc
+++ b/services/ui/ws/window_manager_state.cc
@@ -298,7 +298,9 @@ void WindowManagerState::OnEventAck(mojom::WindowTree* tree,
ProcessNextEventFromQueue();
}
-void WindowManagerState::OnAcceleratorAck(mojom::EventResult result) {
+void WindowManagerState::OnAcceleratorAck(
+ mojom::EventResult result,
+ const std::unordered_map<std::string, std::vector<uint8_t>>& properties) {
if (!in_flight_event_details_ ||
in_flight_event_details_->phase !=
EventDispatchPhase::PRE_TARGET_ACCELERATOR) {
@@ -311,6 +313,9 @@ void WindowManagerState::OnAcceleratorAck(mojom::EventResult result) {
std::move(in_flight_event_details_);
if (result == mojom::EventResult::UNHANDLED) {
+ DCHECK(details->event->IsKeyEvent());
+ if (!properties.empty())
+ details->event->AsKeyEvent()->SetProperties(properties);
event_processing_display_id_ = details->display_id;
event_dispatcher_.ProcessEvent(
*details->event, EventDispatcher::AcceleratorMatchPhase::POST_ONLY);
@@ -381,7 +386,7 @@ void WindowManagerState::OnEventAckTimeout(ClientSpecificId client_id) {
window_tree_->ClientJankinessChanged(hung_tree);
if (in_flight_event_details_->phase ==
EventDispatchPhase::PRE_TARGET_ACCELERATOR) {
- OnAcceleratorAck(mojom::EventResult::UNHANDLED);
+ OnAcceleratorAck(mojom::EventResult::UNHANDLED, KeyEvent::Properties());
} else {
OnEventAck(
in_flight_event_details_ ? in_flight_event_details_->tree : nullptr,
« no previous file with comments | « services/ui/ws/window_manager_state.h ('k') | services/ui/ws/window_manager_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698