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

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

Issue 11364168: Add a workaround for crbug.com/139556. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed unused var Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/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_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 21 matching lines...) Expand all
32 // or if the current accelerator is repeated or not. 32 // or if the current accelerator is repeated or not.
33 class ASH_EXPORT AcceleratorControllerContext { 33 class ASH_EXPORT AcceleratorControllerContext {
34 public: 34 public:
35 AcceleratorControllerContext(); 35 AcceleratorControllerContext();
36 ~AcceleratorControllerContext() {} 36 ~AcceleratorControllerContext() {}
37 37
38 // Updates context - determines if the accelerator is repeated, as well as 38 // Updates context - determines if the accelerator is repeated, as well as
39 // event type of the previous accelerator. 39 // event type of the previous accelerator.
40 void UpdateContext(const ui::Accelerator& accelerator); 40 void UpdateContext(const ui::Accelerator& accelerator);
41 41
42 ui::EventType previous_event_type() const { return previous_event_type_; } 42 const ui::Accelerator& previous_accelerator() const {
43 bool repeated() const { return repeated_; } 43 return previous_accelerator_;
44 }
45 bool repeated() const {
46 return current_accelerator_ == previous_accelerator_ &&
47 current_accelerator_.type() != ui::ET_UNKNOWN;
48 }
44 49
45 private: 50 private:
46 ui::Accelerator current_accelerator_; 51 ui::Accelerator current_accelerator_;
47 52 // Used for NEXT_IME and DISABLE_CAPS_LOCK accelerator actions.
48 // If the current accelerator was repeated. 53 ui::Accelerator previous_accelerator_;
49 bool repeated_;
50
51 // Event type of the previous accelerator. Used for NEXT_IME and
52 // DISABLE_CAPS_LOCK accelerator actions.
53 ui::EventType previous_event_type_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerContext); 55 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerContext);
56 }; 56 };
57 57
58 // AcceleratorController provides functions for registering or unregistering 58 // AcceleratorController provides functions for registering or unregistering
59 // global keyboard accelerators, which are handled earlier than any windows. It 59 // global keyboard accelerators, which are handled earlier than any windows. It
60 // also implements several handlers as an accelerator target. 60 // also implements several handlers as an accelerator target.
61 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { 61 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
62 public: 62 public:
63 AcceleratorController(); 63 AcceleratorController();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 std::set<int> reserved_actions_; 160 std::set<int> reserved_actions_;
161 // Actions which will not be repeated while holding the accelerator key. 161 // Actions which will not be repeated while holding the accelerator key.
162 std::set<int> nonrepeatable_actions_; 162 std::set<int> nonrepeatable_actions_;
163 163
164 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); 164 DISALLOW_COPY_AND_ASSIGN(AcceleratorController);
165 }; 165 };
166 166
167 } // namespace ash 167 } // namespace ash
168 168
169 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ 169 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698