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

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

Issue 2520093003: WindowManagerClient::AddAccelerator() should take an array (Closed)
Patch Set: Improve comments. Created 4 years 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/public/interfaces/window_manager.mojom » ('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..7c80269cfd08c33d9d99363e3e4f378a4a01277c 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,16 @@ 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),
+ window_manager_->window_manager_client()->AddAccelerators(
sky 2016/12/01 22:17:04 Is this only the first change you're intending to
thanhph 2016/12/01 23:32:41 To change this I need to change the callback funct
sky 2016/12/02 00:11:16 I don't think that would help as registration adds
thanhph 2016/12/02 15:11:18 Thanks Scott, I'll keep this in mind. Should I put
+ ui::CreateAcceleratorVector(
+ 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),
+
+ window_manager_->window_manager_client()->AddAccelerators(
+ ui::CreateAcceleratorVector(
+ ComputeAcceleratorId(id_namespace_, ids.post_id),
+ std::move(post_event_matcher)),
base::Bind(OnAcceleratorAdded, accelerator));
}
« no previous file with comments | « no previous file | ash/mus/window_manager.cc » ('j') | services/ui/public/interfaces/window_manager.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698