OLD | NEW |
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 CHROME_COMMON_EXTENSIONS_COMMAND_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_COMMAND_H_ |
6 #define CHROME_COMMON_EXTENSIONS_COMMAND_H_ | 6 #define CHROME_COMMON_EXTENSIONS_COMMAND_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 int index, | 54 int index, |
55 base::string16* error); | 55 base::string16* error); |
56 | 56 |
57 // Accessors: | 57 // Accessors: |
58 const std::string& command_name() const { return command_name_; } | 58 const std::string& command_name() const { return command_name_; } |
59 const ui::Accelerator& accelerator() const { return accelerator_; } | 59 const ui::Accelerator& accelerator() const { return accelerator_; } |
60 const base::string16& description() const { return description_; } | 60 const base::string16& description() const { return description_; } |
61 bool global() const { return global_; } | 61 bool global() const { return global_; } |
62 | 62 |
63 // Setter: | 63 // Setter: |
64 void set_accelerator(ui::Accelerator accelerator) { | 64 void set_accelerator(const ui::Accelerator& accelerator) { |
65 accelerator_ = accelerator; | 65 accelerator_ = accelerator; |
66 } | 66 } |
67 void set_global(bool global) { | 67 void set_global(bool global) { |
68 global_ = global; | 68 global_ = global; |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 std::string command_name_; | 72 std::string command_name_; |
73 ui::Accelerator accelerator_; | 73 ui::Accelerator accelerator_; |
74 base::string16 description_; | 74 base::string16 description_; |
75 bool global_; | 75 bool global_; |
76 }; | 76 }; |
77 | 77 |
78 // A mapping of command name (std::string) to a command object. | 78 // A mapping of command name (std::string) to a command object. |
79 typedef std::map<std::string, Command> CommandMap; | 79 typedef std::map<std::string, Command> CommandMap; |
80 | 80 |
81 } // namespace extensions | 81 } // namespace extensions |
82 | 82 |
83 #endif // CHROME_COMMON_EXTENSIONS_COMMAND_H_ | 83 #endif // CHROME_COMMON_EXTENSIONS_COMMAND_H_ |
OLD | NEW |