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

Side by Side Diff: chrome/common/extensions/command.h

Issue 23445013: Parse media keys for named command in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit fix. Created 7 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
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 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 16 matching lines...) Expand all
27 Command(const std::string& command_name, 27 Command(const std::string& command_name,
28 const string16& description, 28 const string16& description,
29 const std::string& accelerator); 29 const std::string& accelerator);
30 ~Command(); 30 ~Command();
31 31
32 // The platform value for the Command. 32 // The platform value for the Command.
33 static std::string CommandPlatform(); 33 static std::string CommandPlatform();
34 34
35 // Parse a string as an accelerator. If the accelerator is unparsable then 35 // Parse a string as an accelerator. If the accelerator is unparsable then
36 // a generic ui::Accelerator object will be returns (with key_code Unknown). 36 // a generic ui::Accelerator object will be returns (with key_code Unknown).
37 static ui::Accelerator StringToAccelerator(const std::string& accelerator); 37 static ui::Accelerator StringToAccelerator(const std::string& accelerator,
38 const std::string& command_name);
38 39
39 // Returns the string representation of an accelerator without localizing the 40 // Returns the string representation of an accelerator without localizing the
40 // shortcut text (like accelerator::GetShortcutText() does). 41 // shortcut text (like accelerator::GetShortcutText() does).
41 static std::string AcceleratorToString(const ui::Accelerator& accelerator); 42 static std::string AcceleratorToString(const ui::Accelerator& accelerator);
42 43
43 // Parse the command. 44 // Parse the command.
44 bool Parse(const base::DictionaryValue* command, 45 bool Parse(const base::DictionaryValue* command,
45 const std::string& command_name, 46 const std::string& command_name,
46 int index, 47 int index,
47 string16* error); 48 string16* error);
(...skipping 18 matching lines...) Expand all
66 ui::Accelerator accelerator_; 67 ui::Accelerator accelerator_;
67 string16 description_; 68 string16 description_;
68 }; 69 };
69 70
70 // A mapping of command name (std::string) to a command object. 71 // A mapping of command name (std::string) to a command object.
71 typedef std::map<std::string, Command> CommandMap; 72 typedef std::map<std::string, Command> CommandMap;
72 73
73 } // namespace extensions 74 } // namespace extensions
74 75
75 #endif // CHROME_COMMON_EXTENSIONS_COMMAND_H_ 76 #endif // CHROME_COMMON_EXTENSIONS_COMMAND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698