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

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

Issue 1656123002: Moves accelerator registration to WindowManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mandoline Created 4 years, 11 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 | « components/mus/ws/window_tree_impl.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree_impl.cc
diff --git a/components/mus/ws/window_tree_impl.cc b/components/mus/ws/window_tree_impl.cc
index f9d145bfcbcde4ae756d28c4222967dc89842e70..ecb9029514ba95dff668ade53c08d77cc727a3ff 100644
--- a/components/mus/ws/window_tree_impl.cc
+++ b/components/mus/ws/window_tree_impl.cc
@@ -316,6 +316,12 @@ void WindowTreeImpl::OnChangeCompleted(uint32_t change_id, bool success) {
client_->OnChangeCompleted(change_id, success);
}
+void WindowTreeImpl::OnAccelerator(uint32_t accelerator_id,
+ mojom::EventPtr event) {
+ DCHECK(window_manager_internal_);
+ window_manager_internal_->OnAccelerator(accelerator_id, std::move(event));
+}
+
void WindowTreeImpl::ProcessWindowBoundsChanged(const ServerWindow* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
@@ -1193,6 +1199,23 @@ void WindowTreeImpl::GetWindowManagerClient(
this, std::move(internal)));
}
+void WindowTreeImpl::AddAccelerator(uint32_t id,
+ mojom::EventMatcherPtr event_matcher,
+ const AddAcceleratorCallback& callback) {
+ WindowTreeHostImpl* host = GetHostForWindowManager();
+ const bool success =
+ host &&
+ host->event_dispatcher()->AddAccelerator(id, std::move(event_matcher));
+ callback.Run(success);
+}
+
+void WindowTreeImpl::RemoveAccelerator(uint32_t id) {
+ WindowTreeHostImpl* host = GetHostForWindowManager();
+ if (!host)
+ return;
+ host->event_dispatcher()->RemoveAccelerator(id);
+}
+
void WindowTreeImpl::WmResponse(uint32_t change_id, bool response) {
// TODO(sky): think about what else case means.
if (GetHostForWindowManager())
« no previous file with comments | « components/mus/ws/window_tree_impl.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698