OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/mus/accelerators/accelerator_controller_registrar.h" | 5 #include "ash/mus/accelerators/accelerator_controller_registrar.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
10 #include "ash/common/accelerators/accelerator_router.h" | 10 #include "ash/common/accelerators/accelerator_router.h" |
11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
12 #include "ash/mus/accelerators/accelerator_ids.h" | 12 #include "ash/mus/accelerators/accelerator_ids.h" |
13 #include "ash/mus/bridge/wm_window_mus.h" | 13 #include "ash/mus/bridge/wm_window_mus.h" |
14 #include "ash/mus/window_manager.h" | 14 #include "ash/mus/window_manager.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "services/ui/common/accelerator_util.h" | 16 #include "services/ui/common/accelerator_util.h" |
17 #include "services/ui/public/cpp/window_manager_delegate.h" | |
18 #include "services/ui/public/cpp/window_tree_client.h" | |
19 #include "ui/base/accelerators/accelerator_history.h" | 17 #include "ui/base/accelerators/accelerator_history.h" |
20 | 18 |
21 namespace ash { | 19 namespace ash { |
22 namespace mus { | 20 namespace mus { |
23 namespace { | 21 namespace { |
24 | 22 |
25 // Callback from registering the accelerator. | 23 // Callback from registering the accelerator. |
26 void OnAcceleratorAdded(const ui::Accelerator& accelerator, bool added) { | 24 void OnAcceleratorAdded(const ui::Accelerator& accelerator, bool added) { |
27 // All our accelerators should be registered, so we expect |added| to be true. | 25 // All our accelerators should be registered, so we expect |added| to be true. |
28 DCHECK(added) << "duplicate accelerator key_code=" << accelerator.key_code() | 26 DCHECK(added) << "duplicate accelerator key_code=" << accelerator.key_code() |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Common case is we never wrap once, so this is typically cheap. Additionally | 165 // Common case is we never wrap once, so this is typically cheap. Additionally |
168 // we expect there not to be too many accelerators. | 166 // we expect there not to be too many accelerators. |
169 while (ids_.count(next_id_) > 0) | 167 while (ids_.count(next_id_) > 0) |
170 ++next_id_; | 168 ++next_id_; |
171 ids_.insert(next_id_); | 169 ids_.insert(next_id_); |
172 return next_id_++; | 170 return next_id_++; |
173 } | 171 } |
174 | 172 |
175 } // namespace mus | 173 } // namespace mus |
176 } // namespace ash | 174 } // namespace ash |
OLD | NEW |