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

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

Issue 2208443002: Changes accelerators registered by mus to not interfere with those of client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 4 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 | « no previous file | services/ui/ws/window_manager_state.h » ('j') | no next file with comments »
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 1c5ca651d5a7d1c57e3c376bd0c9d38c9ced9cd6..79d7ea794ccaf9247c1c76c5187e4a1abfe8b742 100644
--- a/ash/mus/accelerators/accelerator_controller_registrar.cc
+++ b/ash/mus/accelerators/accelerator_controller_registrar.cc
@@ -22,10 +22,12 @@ namespace ash {
namespace mus {
namespace {
-// Callback from registering the accelerator. All our accelerators should be
-// registered, so we expect |added| to be true.
-void OnAcceleratorAdded(bool added) {
- DCHECK(added);
+// Callback from registering the accelerator.
+void OnAcceleratorAdded(const ui::Accelerator& accelerator, bool added) {
+ // All our accelerators should be registered, so we expect |added| to be true.
+ DCHECK(added) << "duplicate accelerator key_code=" << accelerator.key_code()
+ << " type=" << accelerator.type()
+ << " modifiers=" << accelerator.modifiers();
}
} // namespace
@@ -126,10 +128,11 @@ void AcceleratorControllerRegistrar::OnAcceleratorRegistered(
window_manager_->window_manager_client()->AddAccelerator(
ComputeAcceleratorId(id_namespace_, ids.pre_id), std::move(event_matcher),
- base::Bind(OnAcceleratorAdded));
+ base::Bind(OnAcceleratorAdded, accelerator));
window_manager_->window_manager_client()->AddAccelerator(
ComputeAcceleratorId(id_namespace_, ids.post_id),
- std::move(post_event_matcher), base::Bind(OnAcceleratorAdded));
+ std::move(post_event_matcher),
+ base::Bind(OnAcceleratorAdded, accelerator));
}
void AcceleratorControllerRegistrar::OnAcceleratorUnregistered(
« no previous file with comments | « no previous file | services/ui/ws/window_manager_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698