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

Unified Diff: ash/mus/accelerator_registrar_impl.h

Issue 2105653003: Fixes shutdown race in mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 6 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 | « ash/mus/BUILD.gn ('k') | ash/mus/accelerator_registrar_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/accelerator_registrar_impl.h
diff --git a/ash/mus/accelerator_registrar_impl.h b/ash/mus/accelerator_registrar_impl.h
index e720674e1dd1a7b0f63ce7d5142a988a94d89d1e..1985a747802f5ce0f5dd36d0ae3b37af6b1dff78 100644
--- a/ash/mus/accelerator_registrar_impl.h
+++ b/ash/mus/accelerator_registrar_impl.h
@@ -9,6 +9,7 @@
#include <map>
+#include "ash/mus/window_manager_observer.h"
#include "base/callback.h"
#include "base/macros.h"
#include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
@@ -24,7 +25,8 @@ class WindowManager;
// connection. This manages its own lifetime, and destroys itself when the
// AcceleratorRegistrar and all its AcceleratorHandlers are disconnected. Upon
// destruction, it calls the DestroyCallback.
-class AcceleratorRegistrarImpl : public ::mus::mojom::AcceleratorRegistrar {
+class AcceleratorRegistrarImpl : public ::mus::mojom::AcceleratorRegistrar,
+ public WindowManagerObserver {
public:
using DestroyCallback = base::Callback<void(AcceleratorRegistrarImpl*)>;
AcceleratorRegistrarImpl(WindowManager* window_manager,
@@ -56,6 +58,10 @@ class AcceleratorRegistrarImpl : public ::mus::mojom::AcceleratorRegistrar {
const AddAcceleratorCallback& callback) override;
void RemoveAccelerator(uint32_t accelerator_id) override;
+ // WindowManagerObserver:
+ void OnAccelerator(uint32_t id, const ui::Event& event) override;
+ void OnWindowTreeClientDestroyed() override;
+
WindowManager* window_manager_;
::mus::mojom::AcceleratorHandlerPtr accelerator_handler_;
mojo::Binding<AcceleratorRegistrar> binding_;
« no previous file with comments | « ash/mus/BUILD.gn ('k') | ash/mus/accelerator_registrar_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698