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

Side by Side Diff: ash/common/accelerators/accelerator_controller.h

Issue 2586333003: Make mash register initial batch of accelerators in single shot. (Closed)
Patch Set: Change register to use accelerator vector. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 5 #ifndef ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
6 #define ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 6 #define ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <vector>
13 14
14 #include "ash/ash_export.h" 15 #include "ash/ash_export.h"
15 #include "ash/common/accelerators/accelerator_table.h" 16 #include "ash/common/accelerators/accelerator_table.h"
16 #include "ash/common/accelerators/exit_warning_handler.h" 17 #include "ash/common/accelerators/exit_warning_handler.h"
17 #include "ash/public/interfaces/accelerator_controller.mojom.h" 18 #include "ash/public/interfaces/accelerator_controller.mojom.h"
18 #include "base/compiler_specific.h" 19 #include "base/compiler_specific.h"
19 #include "base/gtest_prod_util.h" 20 #include "base/gtest_prod_util.h"
20 #include "base/macros.h" 21 #include "base/macros.h"
21 #include "mojo/public/cpp/bindings/binding_set.h" 22 #include "mojo/public/cpp/bindings/binding_set.h"
22 #include "ui/base/accelerators/accelerator.h" 23 #include "ui/base/accelerators/accelerator.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Don't process the accelerator. 57 // Don't process the accelerator.
57 RESTRICTION_PREVENT_PROCESSING, 58 RESTRICTION_PREVENT_PROCESSING,
58 59
59 // Don't process the accelerator and prevent propagation to other targets. 60 // Don't process the accelerator and prevent propagation to other targets.
60 RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION 61 RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION
61 }; 62 };
62 63
63 // Registers a global keyboard accelerator for the specified target. If 64 // Registers a global keyboard accelerator for the specified target. If
64 // multiple targets are registered for an accelerator, a target registered 65 // multiple targets are registered for an accelerator, a target registered
65 // later has higher priority. 66 // later has higher priority.
66 void Register(const ui::Accelerator& accelerator, 67
mfomitchev 2016/12/22 01:04:50 Remove space, update comment.
thanhph 2016/12/22 20:36:01 Done.
68 void Register(const std::vector<ui::Accelerator>& accelerators,
67 ui::AcceleratorTarget* target); 69 ui::AcceleratorTarget* target);
68 70
69 // Unregisters the specified keyboard accelerator for the specified target. 71 // Unregisters the specified keyboard accelerator for the specified target.
70 void Unregister(const ui::Accelerator& accelerator, 72 void Unregister(const ui::Accelerator& accelerator,
71 ui::AcceleratorTarget* target); 73 ui::AcceleratorTarget* target);
72 74
73 // Unregisters all keyboard accelerators for the specified target. 75 // Unregisters all keyboard accelerators for the specified target.
74 void UnregisterAll(ui::AcceleratorTarget* target); 76 void UnregisterAll(ui::AcceleratorTarget* target);
75 77
76 // Activates the target associated with the specified accelerator. 78 // Activates the target associated with the specified accelerator.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 std::set<int> actions_needing_window_; 215 std::set<int> actions_needing_window_;
214 // Actions that can be performed without closing the menu (if one is present). 216 // Actions that can be performed without closing the menu (if one is present).
215 std::set<int> actions_keeping_menu_open_; 217 std::set<int> actions_keeping_menu_open_;
216 218
217 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); 219 DISALLOW_COPY_AND_ASSIGN(AcceleratorController);
218 }; 220 };
219 221
220 } // namespace ash 222 } // namespace ash
221 223
222 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 224 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698