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

Side by Side Diff: views/accelerator.h

Issue 179028: Revert "Fix a ton of compiler warnings." (Closed)
Patch Set: Created 11 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
« no previous file with comments | « net/url_request/url_request_unittest.h ('k') | views/controls/menu/simple_menu_model.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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
11 #ifndef VIEWS_ACCELERATOR_H_ 11 #ifndef VIEWS_ACCELERATOR_H_
(...skipping 17 matching lines...) Expand all
29 modifiers_ |= Event::EF_CONTROL_DOWN; 29 modifiers_ |= Event::EF_CONTROL_DOWN;
30 if (alt_pressed) 30 if (alt_pressed)
31 modifiers_ |= Event::EF_ALT_DOWN; 31 modifiers_ |= Event::EF_ALT_DOWN;
32 } 32 }
33 33
34 Accelerator(const Accelerator& accelerator) { 34 Accelerator(const Accelerator& accelerator) {
35 key_code_ = accelerator.key_code_; 35 key_code_ = accelerator.key_code_;
36 modifiers_ = accelerator.modifiers_; 36 modifiers_ = accelerator.modifiers_;
37 } 37 }
38 38
39 ~Accelerator() {}; 39 ~Accelerator() { };
40 40
41 Accelerator& operator=(const Accelerator& accelerator) { 41 Accelerator& operator=(const Accelerator& accelerator) {
42 if (this != &accelerator) { 42 if (this != &accelerator) {
43 key_code_ = accelerator.key_code_; 43 key_code_ = accelerator.key_code_;
44 modifiers_ = accelerator.modifiers_; 44 modifiers_ = accelerator.modifiers_;
45 } 45 }
46 return *this; 46 return *this;
47 } 47 }
48 48
49 // We define the < operator so that the KeyboardShortcut can be used as a key 49 // We define the < operator so that the KeyboardShortcut can be used as a key
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // The state of the Shift/Ctrl/Alt keys (see event.h). 88 // The state of the Shift/Ctrl/Alt keys (see event.h).
89 int modifiers_; 89 int modifiers_;
90 }; 90 };
91 91
92 // An interface that classes that want to register for keyboard accelerators 92 // An interface that classes that want to register for keyboard accelerators
93 // should implement. 93 // should implement.
94 class AcceleratorTarget { 94 class AcceleratorTarget {
95 public: 95 public:
96 // This method should return true if the accelerator was processed. 96 // This method should return true if the accelerator was processed.
97 virtual bool AcceleratorPressed(const Accelerator& accelerator) = 0; 97 virtual bool AcceleratorPressed(const Accelerator& accelerator) = 0;
98 protected:
99 ~AcceleratorTarget() {}
100 }; 98 };
101 } 99 }
102 100
103 #endif // VIEWS_ACCELERATOR_H_ 101 #endif // VIEWS_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.h ('k') | views/controls/menu/simple_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698