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_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 const std::string& command_name, | 160 const std::string& command_name, |
161 int index, | 161 int index, |
162 string16* error); | 162 string16* error); |
163 | 163 |
164 // Accessors: | 164 // Accessors: |
165 const std::string& command_name() const { return command_name_; } | 165 const std::string& command_name() const { return command_name_; } |
166 const ui::Accelerator& accelerator() const { return accelerator_; } | 166 const ui::Accelerator& accelerator() const { return accelerator_; } |
167 const std::string& description() const { return description_; } | 167 const std::string& description() const { return description_; } |
168 | 168 |
169 private: | 169 private: |
170 ui::Accelerator ParseImpl(const std::string& shortcut, | |
171 const std::string& platform_key, | |
172 int index, | |
173 string16* error); | |
170 std::string command_name_; | 174 std::string command_name_; |
171 ui::Accelerator accelerator_; | 175 ui::Accelerator accelerator_; |
172 std::string description_; | 176 std::string description_; |
173 }; | 177 }; |
178 typedef std::map<std::string, ExtensionKeybinding> Commands; | |
Aaron Boodman
2012/03/26 21:44:57
Need a blank line before the typedef.
| |
174 | 179 |
175 struct TtsVoice { | 180 struct TtsVoice { |
176 // Define out of line constructor/destructor to please Clang. | 181 // Define out of line constructor/destructor to please Clang. |
177 TtsVoice(); | 182 TtsVoice(); |
178 ~TtsVoice(); | 183 ~TtsVoice(); |
179 | 184 |
180 std::string voice_name; | 185 std::string voice_name; |
181 std::string lang; | 186 std::string lang; |
182 std::string gender; | 187 std::string gender; |
183 std::set<std::string> event_types; | 188 std::set<std::string> event_types; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 const FileBrowserHandlerList* file_browser_handlers() const { | 558 const FileBrowserHandlerList* file_browser_handlers() const { |
554 return file_browser_handlers_.get(); | 559 return file_browser_handlers_.get(); |
555 } | 560 } |
556 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 561 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
557 const std::vector<NaClModuleInfo>& nacl_modules() const { | 562 const std::vector<NaClModuleInfo>& nacl_modules() const { |
558 return nacl_modules_; | 563 return nacl_modules_; |
559 } | 564 } |
560 const std::vector<InputComponentInfo>& input_components() const { | 565 const std::vector<InputComponentInfo>& input_components() const { |
561 return input_components_; | 566 return input_components_; |
562 } | 567 } |
563 const std::vector<ExtensionKeybinding>& keybindings() const { | 568 const ExtensionKeybinding* browser_action_command() const { |
564 return commands_; | 569 return browser_action_command_.get(); |
570 } | |
571 const ExtensionKeybinding* page_action_command() const { | |
572 return page_action_command_.get(); | |
573 } | |
574 const Commands& named_commands() const { | |
575 return named_commands_; | |
565 } | 576 } |
566 bool has_background_page() const { | 577 bool has_background_page() const { |
567 return background_url_.is_valid() || !background_scripts_.empty(); | 578 return background_url_.is_valid() || !background_scripts_.empty(); |
568 } | 579 } |
569 bool allow_background_js_access() const { | 580 bool allow_background_js_access() const { |
570 return allow_background_js_access_; | 581 return allow_background_js_access_; |
571 } | 582 } |
572 const std::vector<std::string>& background_scripts() const { | 583 const std::vector<std::string>& background_scripts() const { |
573 return background_scripts_; | 584 return background_scripts_; |
574 } | 585 } |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
907 // Optional list of NPAPI plugins and associated properties. | 918 // Optional list of NPAPI plugins and associated properties. |
908 std::vector<PluginInfo> plugins_; | 919 std::vector<PluginInfo> plugins_; |
909 | 920 |
910 // Optional list of NaCl modules and associated properties. | 921 // Optional list of NaCl modules and associated properties. |
911 std::vector<NaClModuleInfo> nacl_modules_; | 922 std::vector<NaClModuleInfo> nacl_modules_; |
912 | 923 |
913 // Optional list of input components and associated properties. | 924 // Optional list of input components and associated properties. |
914 std::vector<InputComponentInfo> input_components_; | 925 std::vector<InputComponentInfo> input_components_; |
915 | 926 |
916 // Optional list of commands (keyboard shortcuts). | 927 // Optional list of commands (keyboard shortcuts). |
917 std::vector<ExtensionKeybinding> commands_; | 928 scoped_ptr<ExtensionKeybinding> browser_action_command_; |
929 scoped_ptr<ExtensionKeybinding> page_action_command_; | |
930 Commands named_commands_; | |
918 | 931 |
919 // Optional list of web accessible extension resources. | 932 // Optional list of web accessible extension resources. |
920 base::hash_set<std::string> web_accessible_resources_; | 933 base::hash_set<std::string> web_accessible_resources_; |
921 | 934 |
922 // Optional URL to a master page of which a single instance should be always | 935 // Optional URL to a master page of which a single instance should be always |
923 // loaded in the background. | 936 // loaded in the background. |
924 GURL background_url_; | 937 GURL background_url_; |
925 | 938 |
926 // Optional list of scripts to use to generate a background page. If this is | 939 // Optional list of scripts to use to generate a background page. If this is |
927 // present, background_url_ will be empty and generated by GetBackgroundURL(). | 940 // present, background_url_ will be empty and generated by GetBackgroundURL(). |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1091 // only contain the removed permissions. | 1104 // only contain the removed permissions. |
1092 const ExtensionPermissionSet* permissions; | 1105 const ExtensionPermissionSet* permissions; |
1093 | 1106 |
1094 UpdatedExtensionPermissionsInfo( | 1107 UpdatedExtensionPermissionsInfo( |
1095 const Extension* extension, | 1108 const Extension* extension, |
1096 const ExtensionPermissionSet* permissions, | 1109 const ExtensionPermissionSet* permissions, |
1097 Reason reason); | 1110 Reason reason); |
1098 }; | 1111 }; |
1099 | 1112 |
1100 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1113 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |