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

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

Issue 11624036: Move the parsing of homepage_url" and "devtools_page" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 11 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_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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 552
553 // Sets the active |permissions|. 553 // Sets the active |permissions|.
554 void SetActivePermissions(const PermissionSet* permissions) const; 554 void SetActivePermissions(const PermissionSet* permissions) const;
555 555
556 // Gets the extension's active permission set. 556 // Gets the extension's active permission set.
557 scoped_refptr<const PermissionSet> GetActivePermissions() const; 557 scoped_refptr<const PermissionSet> GetActivePermissions() const;
558 558
559 // Whether context menu should be shown for page and browser actions. 559 // Whether context menu should be shown for page and browser actions.
560 bool ShowConfigureContextMenus() const; 560 bool ShowConfigureContextMenus() const;
561 561
562 // Returns the Homepage URL for this extension. If homepage_url was not
563 // specified in the manifest, this returns the Google Gallery URL. For
564 // third-party extensions, this returns a blank GURL.
565 GURL GetHomepageURL() const;
566
567 // Returns a list of paths (relative to the extension dir) for images that 562 // Returns a list of paths (relative to the extension dir) for images that
568 // the browser might load (like themes and page action icons). 563 // the browser might load (like themes and page action icons).
569 std::set<FilePath> GetBrowserImages() const; 564 std::set<FilePath> GetBrowserImages() const;
570 565
571 // Get an extension icon as a resource or URL. 566 // Get an extension icon as a resource or URL.
572 ExtensionResource GetIconResource( 567 ExtensionResource GetIconResource(
573 int size, ExtensionIconSet::MatchType match_type) const; 568 int size, ExtensionIconSet::MatchType match_type) const;
574 GURL GetIconURL(int size, ExtensionIconSet::MatchType match_type) const; 569 GURL GetIconURL(int size, ExtensionIconSet::MatchType match_type) const;
575 570
576 // Gets the fully resolved absolute launch URL. 571 // Gets the fully resolved absolute launch URL.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 const std::vector<std::string>& background_scripts() const { 732 const std::vector<std::string>& background_scripts() const {
738 return background_scripts_; 733 return background_scripts_;
739 } 734 }
740 bool has_persistent_background_page() const { 735 bool has_persistent_background_page() const {
741 return has_background_page() && background_page_is_persistent_; 736 return has_background_page() && background_page_is_persistent_;
742 } 737 }
743 bool has_lazy_background_page() const { 738 bool has_lazy_background_page() const {
744 return has_background_page() && !background_page_is_persistent_; 739 return has_background_page() && !background_page_is_persistent_;
745 } 740 }
746 const GURL& options_url() const { return options_url_; } 741 const GURL& options_url() const { return options_url_; }
747 const GURL& devtools_url() const { return devtools_url_; }
748 const GURL& details_url() const { return details_url_;} 742 const GURL& details_url() const { return details_url_;}
749 const PermissionSet* optional_permission_set() const { 743 const PermissionSet* optional_permission_set() const {
750 return optional_permission_set_.get(); 744 return optional_permission_set_.get();
751 } 745 }
752 const PermissionSet* required_permission_set() const { 746 const PermissionSet* required_permission_set() const {
753 return required_permission_set_.get(); 747 return required_permission_set_.get();
754 } 748 }
755 // Appends |new_warnings| to install_warnings(). 749 // Appends |new_warnings| to install_warnings().
756 void AddInstallWarnings(const InstallWarningVector& new_warnings); 750 void AddInstallWarnings(const InstallWarningVector& new_warnings);
757 const InstallWarningVector& install_warnings() const { 751 const InstallWarningVector& install_warnings() const {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 const char* list_error, 893 const char* list_error,
900 const char* value_error, 894 const char* value_error,
901 string16* error); 895 string16* error);
902 bool LoadLaunchContainer(string16* error); 896 bool LoadLaunchContainer(string16* error);
903 bool LoadLaunchURL(string16* error); 897 bool LoadLaunchURL(string16* error);
904 898
905 bool LoadSharedFeatures(const APIPermissionSet& api_permissions, 899 bool LoadSharedFeatures(const APIPermissionSet& api_permissions,
906 string16* error); 900 string16* error);
907 bool LoadDescription(string16* error); 901 bool LoadDescription(string16* error);
908 bool LoadManifestVersion(string16* error); 902 bool LoadManifestVersion(string16* error);
909 bool LoadHomepageURL(string16* error);
910 bool LoadUpdateURL(string16* error); 903 bool LoadUpdateURL(string16* error);
911 bool LoadIcons(string16* error); 904 bool LoadIcons(string16* error);
912 bool LoadCommands(string16* error); 905 bool LoadCommands(string16* error);
913 bool LoadPlugins(string16* error); 906 bool LoadPlugins(string16* error);
914 bool LoadNaClModules(string16* error); 907 bool LoadNaClModules(string16* error);
915 bool LoadWebAccessibleResources(string16* error); 908 bool LoadWebAccessibleResources(string16* error);
916 bool LoadSandboxedPages(string16* error); 909 bool LoadSandboxedPages(string16* error);
917 // Must be called after LoadPlugins(). 910 // Must be called after LoadPlugins().
918 bool LoadRequirements(string16* error); 911 bool LoadRequirements(string16* error);
919 bool LoadDefaultLocale(string16* error); 912 bool LoadDefaultLocale(string16* error);
(...skipping 17 matching lines...) Expand all
937 const base::DictionaryValue& intent_service, 930 const base::DictionaryValue& intent_service,
938 string16* error); 931 string16* error);
939 bool LoadWebIntentServices(string16* error); 932 bool LoadWebIntentServices(string16* error);
940 bool LoadFileHandler(const std::string& handler_id, 933 bool LoadFileHandler(const std::string& handler_id,
941 const base::DictionaryValue& handler_info, 934 const base::DictionaryValue& handler_info,
942 string16* error); 935 string16* error);
943 bool LoadFileHandlers(string16* error); 936 bool LoadFileHandlers(string16* error);
944 bool LoadExtensionFeatures(APIPermissionSet* api_permissions, 937 bool LoadExtensionFeatures(APIPermissionSet* api_permissions,
945 string16* error); 938 string16* error);
946 bool LoadManifestHandlerFeatures(string16* error); 939 bool LoadManifestHandlerFeatures(string16* error);
947 bool LoadDevToolsPage(string16* error);
948 bool LoadInputComponents(const APIPermissionSet& api_permissions, 940 bool LoadInputComponents(const APIPermissionSet& api_permissions,
949 string16* error); 941 string16* error);
950 bool LoadContentScripts(string16* error); 942 bool LoadContentScripts(string16* error);
951 bool LoadPageAction(string16* error); 943 bool LoadPageAction(string16* error);
952 bool LoadBrowserAction(string16* error); 944 bool LoadBrowserAction(string16* error);
953 bool LoadScriptBadge(string16* error); 945 bool LoadScriptBadge(string16* error);
954 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error); 946 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error);
955 bool LoadChromeURLOverrides(string16* error); 947 bool LoadChromeURLOverrides(string16* error);
956 bool LoadTextToSpeechVoices(string16* error); 948 bool LoadTextToSpeechVoices(string16* error);
957 bool LoadIncognitoMode(string16* error); 949 bool LoadIncognitoMode(string16* error);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1142
1151 // True if the background page can be scripted by pages of the app or 1143 // True if the background page can be scripted by pages of the app or
1152 // extension, in which case all such pages must run in the same process. 1144 // extension, in which case all such pages must run in the same process.
1153 // False if such pages are not permitted to script the background page, 1145 // False if such pages are not permitted to script the background page,
1154 // allowing them to run in different processes. 1146 // allowing them to run in different processes.
1155 bool allow_background_js_access_; 1147 bool allow_background_js_access_;
1156 1148
1157 // Optional URL to a page for setting options/preferences. 1149 // Optional URL to a page for setting options/preferences.
1158 GURL options_url_; 1150 GURL options_url_;
1159 1151
1160 // Optional URL to a devtools extension page.
1161 GURL devtools_url_;
1162
1163 // URL to the webstore page of the extension. 1152 // URL to the webstore page of the extension.
1164 GURL details_url_; 1153 GURL details_url_;
1165 1154
1166 // The public key used to sign the contents of the crx package. 1155 // The public key used to sign the contents of the crx package.
1167 std::string public_key_; 1156 std::string public_key_;
1168 1157
1169 // A map of resource id's to relative file paths. 1158 // A map of resource id's to relative file paths.
1170 scoped_ptr<base::DictionaryValue> theme_images_; 1159 scoped_ptr<base::DictionaryValue> theme_images_;
1171 1160
1172 // A map of color names to colors. 1161 // A map of color names to colors.
1173 scoped_ptr<base::DictionaryValue> theme_colors_; 1162 scoped_ptr<base::DictionaryValue> theme_colors_;
1174 1163
1175 // A map of color names to colors. 1164 // A map of color names to colors.
1176 scoped_ptr<base::DictionaryValue> theme_tints_; 1165 scoped_ptr<base::DictionaryValue> theme_tints_;
1177 1166
1178 // A map of display properties. 1167 // A map of display properties.
1179 scoped_ptr<base::DictionaryValue> theme_display_properties_; 1168 scoped_ptr<base::DictionaryValue> theme_display_properties_;
1180 1169
1181 // The homepage for this extension. Useful if it is not hosted by Google and
1182 // therefore does not have a Gallery URL.
1183 GURL homepage_url_;
1184
1185 // URL for fetching an update manifest 1170 // URL for fetching an update manifest
1186 GURL update_url_; 1171 GURL update_url_;
1187 1172
1188 // The manifest from which this extension was created. 1173 // The manifest from which this extension was created.
1189 scoped_ptr<Manifest> manifest_; 1174 scoped_ptr<Manifest> manifest_;
1190 1175
1191 // Stored parsed manifest data. 1176 // Stored parsed manifest data.
1192 ManifestDataMap manifest_data_; 1177 ManifestDataMap manifest_data_;
1193 1178
1194 // Set to true at the end of InitValue when initialization is finished. 1179 // Set to true at the end of InitValue when initialization is finished.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 1299
1315 UpdatedExtensionPermissionsInfo( 1300 UpdatedExtensionPermissionsInfo(
1316 const Extension* extension, 1301 const Extension* extension,
1317 const PermissionSet* permissions, 1302 const PermissionSet* permissions,
1318 Reason reason); 1303 Reason reason);
1319 }; 1304 };
1320 1305
1321 } // namespace extensions 1306 } // namespace extensions
1322 1307
1323 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1308 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698