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

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

Issue 2520093003: WindowManagerClient::AddAccelerator() should take an array (Closed)
Patch Set: Rename/refactor code. Add unit test for multiple accelerators. 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
« no previous file with comments | « no previous file | ash/mus/window_manager.cc » ('j') | services/ui/common/accelerator_util.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2be7329ebdf63ab72074e58012dbb6da6f624fbd 100644
--- a/ash/mus/accelerators/accelerator_controller_registrar.cc
+++ b/ash/mus/accelerators/accelerator_controller_registrar.cc
@@ -13,7 +13,7 @@
#include "ash/mus/bridge/wm_window_mus.h"
#include "ash/mus/window_manager.h"
#include "base/logging.h"
-#include "services/ui/common/event_matcher_util.h"
+#include "services/ui/common/accelerator_util.h"
#include "services/ui/public/cpp/window_manager_delegate.h"
#include "services/ui/public/cpp/window_tree_client.h"
#include "ui/base/accelerators/accelerator_history.h"
@@ -126,12 +126,21 @@ void AcceleratorControllerRegistrar::OnAcceleratorRegistered(
post_event_matcher->accelerator_phase =
ui::mojom::AcceleratorPhase::POST_TARGET;
- window_manager_->window_manager_client()->AddAccelerator(
- ComputeAcceleratorId(id_namespace_, ids.pre_id), std::move(event_matcher),
- base::Bind(OnAcceleratorAdded, accelerator));
- window_manager_->window_manager_client()->AddAccelerator(
- ComputeAcceleratorId(id_namespace_, ids.post_id),
- std::move(post_event_matcher),
+ std::vector<ui::mojom::AcceleratorTransportPtr> pre_accelerators;
mfomitchev 2016/11/29 17:37:26 Don't declare the variable on a separate line and
thanhph 2016/11/29 19:06:41 Done, thanks!
+ pre_accelerators =
+ AddAcceleratorHelper(ComputeAcceleratorId(id_namespace_, ids.pre_id),
+ std::move(event_matcher));
+
+ window_manager_->window_manager_client()->AddAccelerators(
+ std::move(pre_accelerators), base::Bind(OnAcceleratorAdded, accelerator));
+
+ std::vector<ui::mojom::AcceleratorTransportPtr> post_accelerators;
+ post_accelerators =
+ AddAcceleratorHelper(ComputeAcceleratorId(id_namespace_, ids.post_id),
+ std::move(post_event_matcher));
+
+ window_manager_->window_manager_client()->AddAccelerators(
+ std::move(post_accelerators),
base::Bind(OnAcceleratorAdded, accelerator));
}
« no previous file with comments | « no previous file | ash/mus/window_manager.cc » ('j') | services/ui/common/accelerator_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698