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 #include "mash/wm/accelerator_registrar_impl.h" | 5 #include "ash/mus/wm/accelerator_registrar_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 11 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
12 | 12 |
13 namespace mash { | 13 namespace ash { |
14 namespace wm { | 14 namespace muswm { |
15 | 15 |
16 namespace { | 16 namespace { |
17 const int kAcceleratorIdMask = 0xffff; | 17 const int kAcceleratorIdMask = 0xffff; |
18 } | 18 } |
19 | 19 |
20 AcceleratorRegistrarImpl::AcceleratorRegistrarImpl( | 20 AcceleratorRegistrarImpl::AcceleratorRegistrarImpl( |
21 mus::mojom::WindowTreeHost* host, | 21 mus::mojom::WindowTreeHost* host, |
22 uint32_t accelerator_namespace, | 22 uint32_t accelerator_namespace, |
23 mojo::InterfaceRequest<AcceleratorRegistrar> request, | 23 mojo::InterfaceRequest<AcceleratorRegistrar> request, |
24 const DestroyCallback& destroy_callback) | 24 const DestroyCallback& destroy_callback) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return; | 103 return; |
104 host_->RemoveAccelerator(namespaced_accelerator_id); | 104 host_->RemoveAccelerator(namespaced_accelerator_id); |
105 accelerator_ids_.erase(namespaced_accelerator_id); | 105 accelerator_ids_.erase(namespaced_accelerator_id); |
106 // If the registrar is not bound anymore (i.e. the client can no longer | 106 // If the registrar is not bound anymore (i.e. the client can no longer |
107 // install new accelerators), and the last accelerator has been removed, then | 107 // install new accelerators), and the last accelerator has been removed, then |
108 // there's no point keeping this alive anymore. | 108 // there's no point keeping this alive anymore. |
109 if (accelerator_ids_.empty() && !binding_.is_bound()) | 109 if (accelerator_ids_.empty() && !binding_.is_bound()) |
110 delete this; | 110 delete this; |
111 } | 111 } |
112 | 112 |
113 } // namespace wm | 113 } // namespace muswm |
114 } // namespace mash | 114 } // namespace ash |
OLD | NEW |