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

Side by Side Diff: ui/base/accelerators/accelerator.h

Issue 2953643002: Replaced synthetic MouseEvent in CustomButton::AcceleratorPressed() with just an Event. (Closed)
Patch Set: Removed unnecessary local variables. Created 3 years, 5 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 | « no previous file | ui/base/accelerators/accelerator.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 // This class describe a keyboard accelerator (or keyboard shortcut). 5 // This class describe a keyboard accelerator (or keyboard shortcut).
6 // Keyboard accelerators are registered with the FocusManager. 6 // Keyboard accelerators are registered with the FocusManager.
7 // It has a copy constructor and assignment operator so that it can be copied. 7 // It has a copy constructor and assignment operator so that it can be copied.
8 // It also defines the < operator so that it can be used as a key in a std::map. 8 // It also defines the < operator so that it can be used as a key in a std::map.
9 // 9 //
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int modifiers, 46 int modifiers,
47 KeyState key_state = KeyState::PRESSED); 47 KeyState key_state = KeyState::PRESSED);
48 explicit Accelerator(const KeyEvent& key_event); 48 explicit Accelerator(const KeyEvent& key_event);
49 Accelerator(const Accelerator& accelerator); 49 Accelerator(const Accelerator& accelerator);
50 ~Accelerator(); 50 ~Accelerator();
51 51
52 // Masks out all the non-modifiers KeyEvent |flags| and returns only the 52 // Masks out all the non-modifiers KeyEvent |flags| and returns only the
53 // available modifier ones. This does not include EF_IS_REPEAT. 53 // available modifier ones. This does not include EF_IS_REPEAT.
54 static int MaskOutKeyEventFlags(int flags); 54 static int MaskOutKeyEventFlags(int flags);
55 55
56 KeyEvent ToKeyEvent() const;
57
56 Accelerator& operator=(const Accelerator& accelerator); 58 Accelerator& operator=(const Accelerator& accelerator);
57 59
58 // Define the < operator so that the KeyboardShortcut can be used as a key in 60 // Define the < operator so that the KeyboardShortcut can be used as a key in
59 // a std::map. 61 // a std::map.
60 bool operator <(const Accelerator& rhs) const; 62 bool operator <(const Accelerator& rhs) const;
61 63
62 bool operator ==(const Accelerator& rhs) const; 64 bool operator ==(const Accelerator& rhs) const;
63 65
64 bool operator !=(const Accelerator& rhs) const; 66 bool operator !=(const Accelerator& rhs) const;
65 67
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 virtual bool GetAcceleratorForCommandId(int command_id, 132 virtual bool GetAcceleratorForCommandId(int command_id,
131 Accelerator* accelerator) const = 0; 133 Accelerator* accelerator) const = 0;
132 134
133 protected: 135 protected:
134 virtual ~AcceleratorProvider() {} 136 virtual ~AcceleratorProvider() {}
135 }; 137 };
136 138
137 } // namespace ui 139 } // namespace ui
138 140
139 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_ 141 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698