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

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

Issue 14771027: Unify and change logout/sleep/lock shortcuts (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 7 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 23 matching lines...) Expand all
34 // or if the current accelerator is repeated or not. 34 // or if the current accelerator is repeated or not.
35 class ASH_EXPORT AcceleratorControllerContext { 35 class ASH_EXPORT AcceleratorControllerContext {
36 public: 36 public:
37 AcceleratorControllerContext(); 37 AcceleratorControllerContext();
38 ~AcceleratorControllerContext() {} 38 ~AcceleratorControllerContext() {}
39 39
40 // Updates context - determines if the accelerator is repeated, as well as 40 // Updates context - determines if the accelerator is repeated, as well as
41 // event type of the previous accelerator. 41 // event type of the previous accelerator.
42 void UpdateContext(const ui::Accelerator& accelerator); 42 void UpdateContext(const ui::Accelerator& accelerator);
43 43
44 const ui::Accelerator& current_accelerator() const {
45 return current_accelerator_;
46 }
44 const ui::Accelerator& previous_accelerator() const { 47 const ui::Accelerator& previous_accelerator() const {
45 return previous_accelerator_; 48 return previous_accelerator_;
46 } 49 }
47 bool repeated() const { 50 bool repeated() const {
48 return current_accelerator_ == previous_accelerator_ && 51 return current_accelerator_ == previous_accelerator_ &&
49 current_accelerator_.type() != ui::ET_UNKNOWN; 52 current_accelerator_.type() != ui::ET_UNKNOWN;
50 } 53 }
51 54
52 private: 55 private:
53 ui::Accelerator current_accelerator_; 56 ui::Accelerator current_accelerator_;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 std::set<int> nonrepeatable_actions_; 169 std::set<int> nonrepeatable_actions_;
167 // Actions allowed in app mode. 170 // Actions allowed in app mode.
168 std::set<int> actions_allowed_in_app_mode_; 171 std::set<int> actions_allowed_in_app_mode_;
169 172
170 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); 173 DISALLOW_COPY_AND_ASSIGN(AcceleratorController);
171 }; 174 };
172 175
173 } // namespace ash 176 } // namespace ash
174 177
175 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 178 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.cc » ('j') | ash/accelerators/exit_warning_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698