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

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, 12 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 554
555 // Sets the active |permissions|. 555 // Sets the active |permissions|.
556 void SetActivePermissions(const PermissionSet* permissions) const; 556 void SetActivePermissions(const PermissionSet* permissions) const;
557 557
558 // Gets the extension's active permission set. 558 // Gets the extension's active permission set.
559 scoped_refptr<const PermissionSet> GetActivePermissions() const; 559 scoped_refptr<const PermissionSet> GetActivePermissions() const;
560 560
561 // Whether context menu should be shown for page and browser actions. 561 // Whether context menu should be shown for page and browser actions.
562 bool ShowConfigureContextMenus() const; 562 bool ShowConfigureContextMenus() const;
563 563
564 // Returns the Homepage URL for this extension. If homepage_url was not
565 // specified in the manifest, this returns the Google Gallery URL. For
566 // third-party extensions, this returns a blank GURL.
567 GURL GetHomepageURL() const;
568
569 // Returns a list of paths (relative to the extension dir) for images that 564 // Returns a list of paths (relative to the extension dir) for images that
570 // the browser might load (like themes and page action icons). 565 // the browser might load (like themes and page action icons).
571 std::set<FilePath> GetBrowserImages() const; 566 std::set<FilePath> GetBrowserImages() const;
572 567
573 // Get an extension icon as a resource or URL. 568 // Get an extension icon as a resource or URL.
574 ExtensionResource GetIconResource( 569 ExtensionResource GetIconResource(
575 int size, ExtensionIconSet::MatchType match_type) const; 570 int size, ExtensionIconSet::MatchType match_type) const;
576 GURL GetIconURL(int size, ExtensionIconSet::MatchType match_type) const; 571 GURL GetIconURL(int size, ExtensionIconSet::MatchType match_type) const;
577 572
578 // Gets the fully resolved absolute launch URL. 573 // Gets the fully resolved absolute launch URL.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 const std::vector<std::string>& background_scripts() const { 737 const std::vector<std::string>& background_scripts() const {
743 return background_scripts_; 738 return background_scripts_;
744 } 739 }
745 bool has_persistent_background_page() const { 740 bool has_persistent_background_page() const {
746 return has_background_page() && background_page_is_persistent_; 741 return has_background_page() && background_page_is_persistent_;
747 } 742 }
748 bool has_lazy_background_page() const { 743 bool has_lazy_background_page() const {
749 return has_background_page() && !background_page_is_persistent_; 744 return has_background_page() && !background_page_is_persistent_;
750 } 745 }
751 const GURL& options_url() const { return options_url_; } 746 const GURL& options_url() const { return options_url_; }
752 const GURL& devtools_url() const { return devtools_url_; }
753 const GURL& details_url() const { return details_url_;} 747 const GURL& details_url() const { return details_url_;}
754 const PermissionSet* optional_permission_set() const { 748 const PermissionSet* optional_permission_set() const {
755 return optional_permission_set_.get(); 749 return optional_permission_set_.get();
756 } 750 }
757 const PermissionSet* required_permission_set() const { 751 const PermissionSet* required_permission_set() const {
758 return required_permission_set_.get(); 752 return required_permission_set_.get();
759 } 753 }
760 // Appends |new_warnings| to install_warnings(). 754 // Appends |new_warnings| to install_warnings().
761 void AddInstallWarnings(const InstallWarningVector& new_warnings); 755 void AddInstallWarnings(const InstallWarningVector& new_warnings);
762 const InstallWarningVector& install_warnings() const { 756 const InstallWarningVector& install_warnings() const {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 const char* list_error, 898 const char* list_error,
905 const char* value_error, 899 const char* value_error,
906 string16* error); 900 string16* error);
907 bool LoadLaunchContainer(string16* error); 901 bool LoadLaunchContainer(string16* error);
908 bool LoadLaunchURL(string16* error); 902 bool LoadLaunchURL(string16* error);
909 903
910 bool LoadSharedFeatures(const APIPermissionSet& api_permissions, 904 bool LoadSharedFeatures(const APIPermissionSet& api_permissions,
911 string16* error); 905 string16* error);
912 bool LoadDescription(string16* error); 906 bool LoadDescription(string16* error);
913 bool LoadManifestVersion(string16* error); 907 bool LoadManifestVersion(string16* error);
914 bool LoadHomepageURL(string16* error);
915 bool LoadUpdateURL(string16* error); 908 bool LoadUpdateURL(string16* error);
916 bool LoadIcons(string16* error); 909 bool LoadIcons(string16* error);
917 bool LoadCommands(string16* error); 910 bool LoadCommands(string16* error);
918 bool LoadPlugins(string16* error); 911 bool LoadPlugins(string16* error);
919 bool LoadNaClModules(string16* error); 912 bool LoadNaClModules(string16* error);
920 bool LoadWebAccessibleResources(string16* error); 913 bool LoadWebAccessibleResources(string16* error);
921 bool LoadSandboxedPages(string16* error); 914 bool LoadSandboxedPages(string16* error);
922 // Must be called after LoadPlugins(). 915 // Must be called after LoadPlugins().
923 bool LoadRequirements(string16* error); 916 bool LoadRequirements(string16* error);
924 bool LoadDefaultLocale(string16* error); 917 bool LoadDefaultLocale(string16* error);
(...skipping 17 matching lines...) Expand all
942 const base::DictionaryValue& intent_service, 935 const base::DictionaryValue& intent_service,
943 string16* error); 936 string16* error);
944 bool LoadWebIntentServices(string16* error); 937 bool LoadWebIntentServices(string16* error);
945 bool LoadFileHandler(const std::string& handler_id, 938 bool LoadFileHandler(const std::string& handler_id,
946 const base::DictionaryValue& handler_info, 939 const base::DictionaryValue& handler_info,
947 string16* error); 940 string16* error);
948 bool LoadFileHandlers(string16* error); 941 bool LoadFileHandlers(string16* error);
949 bool LoadExtensionFeatures(APIPermissionSet* api_permissions, 942 bool LoadExtensionFeatures(APIPermissionSet* api_permissions,
950 string16* error); 943 string16* error);
951 bool LoadManifestHandlerFeatures(string16* error); 944 bool LoadManifestHandlerFeatures(string16* error);
952 bool LoadDevToolsPage(string16* error);
953 bool LoadInputComponents(const APIPermissionSet& api_permissions, 945 bool LoadInputComponents(const APIPermissionSet& api_permissions,
954 string16* error); 946 string16* error);
955 bool LoadContentScripts(string16* error); 947 bool LoadContentScripts(string16* error);
956 bool LoadPageAction(string16* error); 948 bool LoadPageAction(string16* error);
957 bool LoadBrowserAction(string16* error); 949 bool LoadBrowserAction(string16* error);
958 bool LoadScriptBadge(string16* error); 950 bool LoadScriptBadge(string16* error);
959 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error); 951 bool LoadSystemIndicator(APIPermissionSet* api_permissions, string16* error);
960 bool LoadFileBrowserHandlers(string16* error); 952 bool LoadFileBrowserHandlers(string16* error);
961 // Helper method to load a FileBrowserHandlerList from the manifest. 953 // Helper method to load a FileBrowserHandlerList from the manifest.
962 FileBrowserHandlerList* LoadFileBrowserHandlersHelper( 954 FileBrowserHandlerList* LoadFileBrowserHandlersHelper(
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 1157
1166 // True if the background page can be scripted by pages of the app or 1158 // True if the background page can be scripted by pages of the app or
1167 // extension, in which case all such pages must run in the same process. 1159 // extension, in which case all such pages must run in the same process.
1168 // False if such pages are not permitted to script the background page, 1160 // False if such pages are not permitted to script the background page,
1169 // allowing them to run in different processes. 1161 // allowing them to run in different processes.
1170 bool allow_background_js_access_; 1162 bool allow_background_js_access_;
1171 1163
1172 // Optional URL to a page for setting options/preferences. 1164 // Optional URL to a page for setting options/preferences.
1173 GURL options_url_; 1165 GURL options_url_;
1174 1166
1175 // Optional URL to a devtools extension page.
1176 GURL devtools_url_;
1177
1178 // URL to the webstore page of the extension. 1167 // URL to the webstore page of the extension.
1179 GURL details_url_; 1168 GURL details_url_;
1180 1169
1181 // The public key used to sign the contents of the crx package. 1170 // The public key used to sign the contents of the crx package.
1182 std::string public_key_; 1171 std::string public_key_;
1183 1172
1184 // A map of resource id's to relative file paths. 1173 // A map of resource id's to relative file paths.
1185 scoped_ptr<base::DictionaryValue> theme_images_; 1174 scoped_ptr<base::DictionaryValue> theme_images_;
1186 1175
1187 // A map of color names to colors. 1176 // A map of color names to colors.
1188 scoped_ptr<base::DictionaryValue> theme_colors_; 1177 scoped_ptr<base::DictionaryValue> theme_colors_;
1189 1178
1190 // A map of color names to colors. 1179 // A map of color names to colors.
1191 scoped_ptr<base::DictionaryValue> theme_tints_; 1180 scoped_ptr<base::DictionaryValue> theme_tints_;
1192 1181
1193 // A map of display properties. 1182 // A map of display properties.
1194 scoped_ptr<base::DictionaryValue> theme_display_properties_; 1183 scoped_ptr<base::DictionaryValue> theme_display_properties_;
1195 1184
1196 // The homepage for this extension. Useful if it is not hosted by Google and
1197 // therefore does not have a Gallery URL.
1198 GURL homepage_url_;
1199
1200 // URL for fetching an update manifest 1185 // URL for fetching an update manifest
1201 GURL update_url_; 1186 GURL update_url_;
1202 1187
1203 // The manifest from which this extension was created. 1188 // The manifest from which this extension was created.
1204 scoped_ptr<Manifest> manifest_; 1189 scoped_ptr<Manifest> manifest_;
1205 1190
1206 // Stored parsed manifest data. 1191 // Stored parsed manifest data.
1207 ManifestDataMap manifest_data_; 1192 ManifestDataMap manifest_data_;
1208 1193
1209 // Set to true at the end of InitValue when initialization is finished. 1194 // Set to true at the end of InitValue when initialization is finished.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 1314
1330 UpdatedExtensionPermissionsInfo( 1315 UpdatedExtensionPermissionsInfo(
1331 const Extension* extension, 1316 const Extension* extension,
1332 const PermissionSet* permissions, 1317 const PermissionSet* permissions,
1333 Reason reason); 1318 Reason reason);
1334 }; 1319 };
1335 1320
1336 } // namespace extensions 1321 } // namespace extensions
1337 1322
1338 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1323 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698