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

Unified Diff: ash/mus/accelerators/accelerator_controller_registrar.cc

Issue 2520093003: WindowManagerClient::AddAccelerator() should take an array (Closed)
Patch Set: Forget to add these files to previous patch. Created 4 years, 1 month 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: ash/mus/accelerators/accelerator_controller_registrar.cc
diff --git a/ash/mus/accelerators/accelerator_controller_registrar.cc b/ash/mus/accelerators/accelerator_controller_registrar.cc
index 79d7ea794ccaf9247c1c76c5187e4a1abfe8b742..94fa95c36f0a39a2a44c2ce9928bc64615dc40c3 100644
--- a/ash/mus/accelerators/accelerator_controller_registrar.cc
+++ b/ash/mus/accelerators/accelerator_controller_registrar.cc
@@ -125,13 +125,28 @@ void AcceleratorControllerRegistrar::OnAcceleratorRegistered(
ui::mojom::EventMatcherPtr post_event_matcher = event_matcher.Clone();
post_event_matcher->accelerator_phase =
ui::mojom::AcceleratorPhase::POST_TARGET;
+ ui::mojom::AcceleratorEventPtr accelerator_pre_event(
mfomitchev 2016/11/22 22:44:16 This doesn't make much sense. You are just creatin
mfomitchev 2016/11/22 23:07:13 Nvm, I guess you have to do this b/c you removed t
thanhph 2016/11/24 16:10:12 Thanks! I created a wrapper around single pair of
+ ui::mojom::AcceleratorEvent::New());
+ accelerator_pre_event->id = ComputeAcceleratorId(id_namespace_, ids.pre_id);
+ accelerator_pre_event->event_matcher = std::move(event_matcher);
+
+ mojo::Array<ui::mojom::AcceleratorEventPtr> pre_multi_accelerators;
+ pre_multi_accelerators.push_back(std::move(accelerator_pre_event));
window_manager_->window_manager_client()->AddAccelerator(
- ComputeAcceleratorId(id_namespace_, ids.pre_id), std::move(event_matcher),
+ std::move(pre_multi_accelerators),
base::Bind(OnAcceleratorAdded, accelerator));
+
+ ui::mojom::AcceleratorEventPtr accelerator_post_event(
+ ui::mojom::AcceleratorEvent::New());
+ accelerator_post_event->id = ComputeAcceleratorId(id_namespace_, ids.post_id);
+ accelerator_post_event->event_matcher = std::move(post_event_matcher);
+
+ mojo::Array<ui::mojom::AcceleratorEventPtr> post_multi_accelerators;
+ post_multi_accelerators.push_back(std::move(accelerator_post_event));
+
window_manager_->window_manager_client()->AddAccelerator(
- ComputeAcceleratorId(id_namespace_, ids.post_id),
- std::move(post_event_matcher),
+ std::move(post_multi_accelerators),
base::Bind(OnAcceleratorAdded, accelerator));
}
« no previous file with comments | « no previous file | services/ui/public/cpp/window_manager_delegate.h » ('j') | services/ui/public/cpp/window_manager_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698