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

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

Issue 1939133002: StructTraits to map mus::mojom::Event to unique_ptr<ui::Event> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback. Created 4 years, 6 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
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 387e5aa74df858a8f604359c2ac3fc97354e8e36..ddfc4cfcb98477a314f2c82e7b12ca4fd1450f89 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -399,8 +399,10 @@ void WindowTree::OnChangeCompleted(uint32_t change_id, bool success) {
void WindowTree::OnAccelerator(uint32_t accelerator_id,
const ui::Event& event) {
DCHECK(window_manager_internal_);
+ // TODO(moshayedi): crbug.com/617167. Don't clone even once we map
+ // mojom::Event directly to ui::Event.
window_manager_internal_->OnAccelerator(accelerator_id,
- mojom::Event::From(event));
+ ui::Event::Clone(event));
}
void WindowTree::ClientJankinessChanged(WindowTree* tree) {
@@ -964,12 +966,12 @@ void WindowTree::DispatchInputEventImpl(ServerWindow* target,
event_observer_matcher_ && event_observer_matcher_->MatchesEvent(event);
client()->OnWindowInputEvent(
event_ack_id_, ClientWindowIdForWindow(target).id,
- mojom::Event::From(event), matched_observer ? event_observer_id_ : 0);
+ ui::Event::Clone(event), matched_observer ? event_observer_id_ : 0);
}
void WindowTree::SendToEventObserver(const ui::Event& event) {
if (event_observer_matcher_ && event_observer_matcher_->MatchesEvent(event))
- client()->OnEventObserved(mojom::Event::From(event), event_observer_id_);
+ client()->OnEventObserved(ui::Event::Clone(event), event_observer_id_);
}
void WindowTree::NewWindow(
« no previous file with comments | « components/mus/ws/window_manager_state_unittest.cc ('k') | components/mus/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698