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

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

Issue 11361189: Initial skeleton for System Indicator API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add manifest parsing and integrate with extension action api handlers. Created 8 years 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_EXTENSION_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 struct ActionInfo { 218 struct ActionInfo {
219 explicit ActionInfo(); 219 explicit ActionInfo();
220 ~ActionInfo(); 220 ~ActionInfo();
221 221
222 // The types of extension actions. 222 // The types of extension actions.
223 enum Type { 223 enum Type {
224 TYPE_BROWSER, 224 TYPE_BROWSER,
225 TYPE_PAGE, 225 TYPE_PAGE,
226 TYPE_SCRIPT_BADGE, 226 TYPE_SCRIPT_BADGE,
227 TYPE_SYSTEM_INDICATOR,
227 }; 228 };
228 229
229 // Empty implies the key wasn't present. 230 // Empty implies the key wasn't present.
230 ExtensionIconSet default_icon; 231 ExtensionIconSet default_icon;
231 std::string default_title; 232 std::string default_title;
232 GURL default_popup_url; 233 GURL default_popup_url;
233 // action id -- only used with legacy page actions API. 234 // action id -- only used with legacy page actions API.
234 std::string id; 235 std::string id;
235 }; 236 };
236 237
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 return converted_from_user_script_; 660 return converted_from_user_script_;
660 } 661 }
661 const UserScriptList& content_scripts() const { return content_scripts_; } 662 const UserScriptList& content_scripts() const { return content_scripts_; }
662 const ActionInfo* script_badge_info() const { 663 const ActionInfo* script_badge_info() const {
663 return script_badge_info_.get(); 664 return script_badge_info_.get();
664 } 665 }
665 const ActionInfo* page_action_info() const { return page_action_info_.get(); } 666 const ActionInfo* page_action_info() const { return page_action_info_.get(); }
666 const ActionInfo* browser_action_info() const { 667 const ActionInfo* browser_action_info() const {
667 return browser_action_info_.get(); 668 return browser_action_info_.get();
668 } 669 }
670 const ActionInfo* system_indicator_info() const {
671 return system_indicator_info_.get();
672 }
669 bool is_verbose_install_message() const { 673 bool is_verbose_install_message() const {
670 return !omnibox_keyword().empty() || 674 return !omnibox_keyword().empty() ||
671 browser_action_info() || 675 browser_action_info() ||
672 (page_action_info() && 676 (page_action_info() &&
673 (page_action_command() || 677 (page_action_command() ||
674 !page_action_info()->default_icon.empty())); 678 !page_action_info()->default_icon.empty()));
675 } 679 }
676 const FileBrowserHandlerList* file_browser_handlers() const { 680 const FileBrowserHandlerList* file_browser_handlers() const {
677 return file_browser_handlers_.get(); 681 return file_browser_handlers_.get();
678 } 682 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 string16* error); 907 string16* error);
904 // Parses a single action in the manifest. 908 // Parses a single action in the manifest.
905 bool LoadWebIntentAction(const std::string& action_name, 909 bool LoadWebIntentAction(const std::string& action_name,
906 const base::DictionaryValue& intent_service, 910 const base::DictionaryValue& intent_service,
907 string16* error); 911 string16* error);
908 bool LoadWebIntentServices(string16* error); 912 bool LoadWebIntentServices(string16* error);
909 bool LoadFileHandler(const std::string& handler_id, 913 bool LoadFileHandler(const std::string& handler_id,
910 const base::DictionaryValue& handler_info, 914 const base::DictionaryValue& handler_info,
911 string16* error); 915 string16* error);
912 bool LoadFileHandlers(string16* error); 916 bool LoadFileHandlers(string16* error);
913 bool LoadExtensionFeatures(const APIPermissionSet& api_permissions, 917 bool LoadExtensionFeatures(APIPermissionSet* api_permissions,
914 string16* error); 918 string16* error);
915 bool LoadDevToolsPage(string16* error); 919 bool LoadDevToolsPage(string16* error);
916 bool LoadInputComponents(const APIPermissionSet& api_permissions, 920 bool LoadInputComponents(const APIPermissionSet& api_permissions,
917 string16* error); 921 string16* error);
918 bool LoadContentScripts(string16* error); 922 bool LoadContentScripts(string16* error);
919 bool LoadPageAction(string16* error); 923 bool LoadPageAction(string16* error);
920 bool LoadBrowserAction(string16* error); 924 bool LoadBrowserAction(string16* error);
921 bool LoadScriptBadge(string16* error); 925 bool LoadScriptBadge(string16* error);
926 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error);
922 bool LoadFileBrowserHandlers(string16* error); 927 bool LoadFileBrowserHandlers(string16* error);
923 // Helper method to load a FileBrowserHandlerList from the manifest. 928 // Helper method to load a FileBrowserHandlerList from the manifest.
924 FileBrowserHandlerList* LoadFileBrowserHandlersHelper( 929 FileBrowserHandlerList* LoadFileBrowserHandlersHelper(
925 const base::ListValue* extension_actions, string16* error); 930 const base::ListValue* extension_actions, string16* error);
926 // Helper method to load an FileBrowserHandler from manifest. 931 // Helper method to load an FileBrowserHandler from manifest.
927 FileBrowserHandler* LoadFileBrowserHandler( 932 FileBrowserHandler* LoadFileBrowserHandler(
928 const base::DictionaryValue* file_browser_handlers, string16* error); 933 const base::DictionaryValue* file_browser_handlers, string16* error);
929 bool LoadChromeURLOverrides(string16* error); 934 bool LoadChromeURLOverrides(string16* error);
930 bool LoadOmnibox(string16* error); 935 bool LoadOmnibox(string16* error);
931 bool LoadTextToSpeechVoices(string16* error); 936 bool LoadTextToSpeechVoices(string16* error);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 1079
1075 // The extension's page action, if any. 1080 // The extension's page action, if any.
1076 scoped_ptr<ActionInfo> page_action_info_; 1081 scoped_ptr<ActionInfo> page_action_info_;
1077 1082
1078 // The extension's browser action, if any. 1083 // The extension's browser action, if any.
1079 scoped_ptr<ActionInfo> browser_action_info_; 1084 scoped_ptr<ActionInfo> browser_action_info_;
1080 1085
1081 // The extension's script badge. Never NULL. 1086 // The extension's script badge. Never NULL.
1082 scoped_ptr<ActionInfo> script_badge_info_; 1087 scoped_ptr<ActionInfo> script_badge_info_;
1083 1088
1089 // The extension's system indicator, if any.
1090 scoped_ptr<ActionInfo> system_indicator_info_;
1091
1084 // The extension's file browser actions, if any. 1092 // The extension's file browser actions, if any.
1085 scoped_ptr<FileBrowserHandlerList> file_browser_handlers_; 1093 scoped_ptr<FileBrowserHandlerList> file_browser_handlers_;
1086 1094
1087 // Optional list of NPAPI plugins and associated properties. 1095 // Optional list of NPAPI plugins and associated properties.
1088 std::vector<PluginInfo> plugins_; 1096 std::vector<PluginInfo> plugins_;
1089 1097
1090 // Optional list of NaCl modules and associated properties. 1098 // Optional list of NaCl modules and associated properties.
1091 std::vector<NaClModuleInfo> nacl_modules_; 1099 std::vector<NaClModuleInfo> nacl_modules_;
1092 1100
1093 // Optional list of input components and associated properties. 1101 // Optional list of input components and associated properties.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 1291
1284 UpdatedExtensionPermissionsInfo( 1292 UpdatedExtensionPermissionsInfo(
1285 const Extension* extension, 1293 const Extension* extension,
1286 const PermissionSet* permissions, 1294 const PermissionSet* permissions,
1287 Reason reason); 1295 Reason reason);
1288 }; 1296 };
1289 1297
1290 } // namespace extensions 1298 } // namespace extensions
1291 1299
1292 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1300 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698