OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MASH_WM_ACCELERATOR_REGISTRAR_IMPL_H_ | 5 #ifndef ASH_MUS_WM_ACCELERATOR_REGISTRAR_IMPL_H_ |
6 #define MASH_WM_ACCELERATOR_REGISTRAR_IMPL_H_ | 6 #define ASH_MUS_WM_ACCELERATOR_REGISTRAR_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" | 14 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" |
15 #include "mojo/common/weak_binding_set.h" | 15 #include "mojo/common/weak_binding_set.h" |
16 #include "mojo/public/cpp/bindings/strong_binding.h" | 16 #include "mojo/public/cpp/bindings/strong_binding.h" |
17 | 17 |
18 namespace mus { | 18 namespace mus { |
19 namespace mojom { | 19 namespace mojom { |
20 class WindowTreeHost; | 20 class WindowTreeHost; |
21 } | 21 } |
22 } | 22 } |
23 | 23 |
24 namespace mash { | 24 namespace ash { |
25 namespace wm { | 25 namespace muswm { |
26 | 26 |
27 class WindowManagerApplication; | 27 class WindowManagerApplication; |
28 | 28 |
29 // Manages AcceleratorHandlers from a particular AcceleratorRegistrar | 29 // Manages AcceleratorHandlers from a particular AcceleratorRegistrar |
30 // connection. This manages its own lifetime, and destroys itself when the | 30 // connection. This manages its own lifetime, and destroys itself when the |
31 // AcceleratorRegistrar and all its AcceleratorHandlers are disconnected. Upon | 31 // AcceleratorRegistrar and all its AcceleratorHandlers are disconnected. Upon |
32 // destruction, it calls the DestroyCallback. | 32 // destruction, it calls the DestroyCallback. |
33 class AcceleratorRegistrarImpl : public mus::mojom::AcceleratorRegistrar { | 33 class AcceleratorRegistrarImpl : public mus::mojom::AcceleratorRegistrar { |
34 public: | 34 public: |
35 using DestroyCallback = base::Callback<void(AcceleratorRegistrarImpl*)>; | 35 using DestroyCallback = base::Callback<void(AcceleratorRegistrarImpl*)>; |
(...skipping 22 matching lines...) Expand all Loading... |
58 mus::mojom::WindowTreeHost* host_; | 58 mus::mojom::WindowTreeHost* host_; |
59 mus::mojom::AcceleratorHandlerPtr accelerator_handler_; | 59 mus::mojom::AcceleratorHandlerPtr accelerator_handler_; |
60 mojo::Binding<AcceleratorRegistrar> binding_; | 60 mojo::Binding<AcceleratorRegistrar> binding_; |
61 uint32_t accelerator_namespace_; | 61 uint32_t accelerator_namespace_; |
62 std::set<uint32_t> accelerator_ids_; | 62 std::set<uint32_t> accelerator_ids_; |
63 DestroyCallback destroy_callback_; | 63 DestroyCallback destroy_callback_; |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(AcceleratorRegistrarImpl); | 65 DISALLOW_COPY_AND_ASSIGN(AcceleratorRegistrarImpl); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace wm | 68 } // namespace muswm |
69 } // namespace mash | 69 } // namespace ash |
70 | 70 |
71 #endif // MASH_WM_ACCELERATOR_REGISTRAR_IMPL_H_ | 71 #endif // ASH_MUS_WM_ACCELERATOR_REGISTRAR_IMPL_H_ |
OLD | NEW |