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

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

Issue 1138523006: Enable keyboard accelerators while a menu is open (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename the enum values Created 5 years, 3 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
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_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 5 #ifndef ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
6 #define ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 6 #define ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 ScreenshotDelegate* screenshot_delegate() { 111 ScreenshotDelegate* screenshot_delegate() {
112 return screenshot_delegate_.get(); 112 return screenshot_delegate_.get();
113 } 113 }
114 114
115 // Provides access to the ExitWarningHandler for testing. 115 // Provides access to the ExitWarningHandler for testing.
116 ExitWarningHandler* GetExitWarningHandlerForTest() { 116 ExitWarningHandler* GetExitWarningHandlerForTest() {
117 return &exit_warning_handler_; 117 return &exit_warning_handler_;
118 } 118 }
119 119
120 // Checks if the given accelerator can be performed without the need to close
121 // the menu (if one is present), returns false if this is the case, and true
122 // otherwise (the menu should be closed and the accelerator should be reposted
123 // after the menu exits).
pkotwicz 2015/09/10 19:13:00 Nit: I think this would make for a simpler comment
afakhry 2015/09/10 20:57:13 Done.
124 bool ShouldCloseMenuAndRepostAccelerator(
125 const ui::Accelerator& accelerator) const;
126
120 ui::AcceleratorHistory* accelerator_history() { 127 ui::AcceleratorHistory* accelerator_history() {
121 return accelerator_history_.get(); 128 return accelerator_history_.get();
122 } 129 }
123 130
124 // Overridden from ui::AcceleratorTarget: 131 // Overridden from ui::AcceleratorTarget:
125 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 132 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
126 bool CanHandleAccelerators() const override; 133 bool CanHandleAccelerators() const override;
127 134
128 private: 135 private:
129 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators); 136 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Preferred actions. See accelerator_table.h for details. 203 // Preferred actions. See accelerator_table.h for details.
197 std::set<int> preferred_actions_; 204 std::set<int> preferred_actions_;
198 // Reserved actions. See accelerator_table.h for details. 205 // Reserved actions. See accelerator_table.h for details.
199 std::set<int> reserved_actions_; 206 std::set<int> reserved_actions_;
200 // Actions which will not be repeated while holding the accelerator key. 207 // Actions which will not be repeated while holding the accelerator key.
201 std::set<int> nonrepeatable_actions_; 208 std::set<int> nonrepeatable_actions_;
202 // Actions allowed in app mode. 209 // Actions allowed in app mode.
203 std::set<int> actions_allowed_in_app_mode_; 210 std::set<int> actions_allowed_in_app_mode_;
204 // Actions disallowed if there are no windows. 211 // Actions disallowed if there are no windows.
205 std::set<int> actions_needing_window_; 212 std::set<int> actions_needing_window_;
213 // Actions that can be performed without closing the menu (if one is present).
214 std::set<int> actions_keeping_menu_open_;
206 215
207 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); 216 DISALLOW_COPY_AND_ASSIGN(AcceleratorController);
208 }; 217 };
209 218
210 } // namespace ash 219 } // namespace ash
211 220
212 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 221 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.cc » ('j') | ash/accelerators/accelerator_table.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698