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

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

Issue 2187703003: Wires up registering accelerators from mash with the wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/common/accelerators/accelerator_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13
14 #include "ash/ash_export.h" 14 #include "ash/ash_export.h"
15 #include "ash/common/accelerators/accelerator_table.h" 15 #include "ash/common/accelerators/accelerator_table.h"
16 #include "ash/common/accelerators/exit_warning_handler.h" 16 #include "ash/common/accelerators/exit_warning_handler.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "ui/base/accelerators/accelerator.h" 20 #include "ui/base/accelerators/accelerator.h"
21 #include "ui/base/accelerators/accelerator_history.h" 21 #include "ui/base/accelerators/accelerator_history.h"
22 22
23 namespace ui { 23 namespace ui {
24 class AcceleratorManager; 24 class AcceleratorManager;
25 class AcceleratorManagerDelegate;
25 } 26 }
26 27
27 namespace ash { 28 namespace ash {
28 29
29 struct AcceleratorData; 30 struct AcceleratorData;
30 class AcceleratorControllerDelegate; 31 class AcceleratorControllerDelegate;
31 class ExitWarningHandler; 32 class ExitWarningHandler;
32 class ImeControlDelegate; 33 class ImeControlDelegate;
33 34
34 // AcceleratorController provides functions for registering or unregistering 35 // AcceleratorController provides functions for registering or unregistering
35 // global keyboard accelerators, which are handled earlier than any windows. It 36 // global keyboard accelerators, which are handled earlier than any windows. It
36 // also implements several handlers as an accelerator target. 37 // also implements several handlers as an accelerator target.
37 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { 38 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
38 public: 39 public:
39 explicit AcceleratorController(AcceleratorControllerDelegate* delegate); 40 AcceleratorController(AcceleratorControllerDelegate* delegate,
41 ui::AcceleratorManagerDelegate* manager_delegate);
40 ~AcceleratorController() override; 42 ~AcceleratorController() override;
41 43
42 // A list of possible ways in which an accelerator should be restricted before 44 // A list of possible ways in which an accelerator should be restricted before
43 // processing. Any target registered with this controller should respect 45 // processing. Any target registered with this controller should respect
44 // restrictions by calling |GetCurrentAcceleratorRestriction| during 46 // restrictions by calling |GetCurrentAcceleratorRestriction| during
45 // processing. 47 // processing.
46 enum AcceleratorProcessingRestriction { 48 enum AcceleratorProcessingRestriction {
47 // Process the accelerator normally. 49 // Process the accelerator normally.
48 RESTRICTION_NONE, 50 RESTRICTION_NONE,
49 51
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 std::set<int> actions_needing_window_; 196 std::set<int> actions_needing_window_;
195 // Actions that can be performed without closing the menu (if one is present). 197 // Actions that can be performed without closing the menu (if one is present).
196 std::set<int> actions_keeping_menu_open_; 198 std::set<int> actions_keeping_menu_open_;
197 199
198 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); 200 DISALLOW_COPY_AND_ASSIGN(AcceleratorController);
199 }; 201 };
200 202
201 } // namespace ash 203 } // namespace ash
202 204
203 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 205 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/common/accelerators/accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698