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

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

Issue 10782030: Add content pack information to Extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 | Annotate | Revision Log
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Do not change the order of entries or remove entries in this list 117 // Do not change the order of entries or remove entries in this list
118 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. 118 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions.
119 enum Type { 119 enum Type {
120 TYPE_UNKNOWN = 0, 120 TYPE_UNKNOWN = 0,
121 TYPE_EXTENSION, 121 TYPE_EXTENSION,
122 TYPE_THEME, 122 TYPE_THEME,
123 TYPE_USER_SCRIPT, 123 TYPE_USER_SCRIPT,
124 TYPE_HOSTED_APP, 124 TYPE_HOSTED_APP,
125 TYPE_PACKAGED_APP, 125 TYPE_PACKAGED_APP,
126 TYPE_PLATFORM_APP 126 TYPE_PLATFORM_APP,
127 TYPE_CONTENT_PACK,
127 }; 128 };
128 129
129 enum SyncType { 130 enum SyncType {
130 SYNC_TYPE_NONE = 0, 131 SYNC_TYPE_NONE = 0,
131 SYNC_TYPE_EXTENSION, 132 SYNC_TYPE_EXTENSION,
132 SYNC_TYPE_APP 133 SYNC_TYPE_APP
133 }; 134 };
134 135
135 // An NPAPI plugin included in the extension. 136 // An NPAPI plugin included in the extension.
136 struct PluginInfo { 137 struct PluginInfo {
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 703
703 // Theme-related. 704 // Theme-related.
704 bool is_theme() const; 705 bool is_theme() const;
705 base::DictionaryValue* GetThemeImages() const { return theme_images_.get(); } 706 base::DictionaryValue* GetThemeImages() const { return theme_images_.get(); }
706 base::DictionaryValue* GetThemeColors() const {return theme_colors_.get(); } 707 base::DictionaryValue* GetThemeColors() const {return theme_colors_.get(); }
707 base::DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } 708 base::DictionaryValue* GetThemeTints() const { return theme_tints_.get(); }
708 base::DictionaryValue* GetThemeDisplayProperties() const { 709 base::DictionaryValue* GetThemeDisplayProperties() const {
709 return theme_display_properties_.get(); 710 return theme_display_properties_.get();
710 } 711 }
711 712
713 // Content pack related.
714 bool is_content_pack() const;
715 FilePath GetContentPackSiteList() const;
Aaron Boodman 2012/08/15 04:05:18 Seems like this should be an ExtensionResource.
Bernhard Bauer 2012/08/15 19:35:09 Done.
716
712 GURL GetBackgroundURL() const; 717 GURL GetBackgroundURL() const;
713 718
714 private: 719 private:
715 friend class base::RefCountedThreadSafe<Extension>; 720 friend class base::RefCountedThreadSafe<Extension>;
716 721
717 // We keep a cache of images loaded from extension resources based on their 722 // We keep a cache of images loaded from extension resources based on their
718 // path and a string representation of a size that may have been used to 723 // path and a string representation of a size that may have been used to
719 // scale it (or the empty string if the image is at its original size). 724 // scale it (or the empty string if the image is at its original size).
720 typedef std::pair<FilePath, std::string> ImageCacheKey; 725 typedef std::pair<FilePath, std::string> ImageCacheKey;
721 typedef std::map<ImageCacheKey, SkBitmap> ImageCache; 726 typedef std::map<ImageCacheKey, SkBitmap> ImageCache;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 bool LoadThemeFeatures(string16* error); 856 bool LoadThemeFeatures(string16* error);
852 bool LoadThemeImages(const base::DictionaryValue* theme_value, 857 bool LoadThemeImages(const base::DictionaryValue* theme_value,
853 string16* error); 858 string16* error);
854 bool LoadThemeColors(const base::DictionaryValue* theme_value, 859 bool LoadThemeColors(const base::DictionaryValue* theme_value,
855 string16* error); 860 string16* error);
856 bool LoadThemeTints(const base::DictionaryValue* theme_value, 861 bool LoadThemeTints(const base::DictionaryValue* theme_value,
857 string16* error); 862 string16* error);
858 bool LoadThemeDisplayProperties(const base::DictionaryValue* theme_value, 863 bool LoadThemeDisplayProperties(const base::DictionaryValue* theme_value,
859 string16* error); 864 string16* error);
860 865
866 bool LoadManagedModeFeatures(string16* error);
867 bool LoadManagedModeSites(
868 const base::DictionaryValue* content_pack_value,
869 string16* error);
861 // Helper function for implementing HasCachedImage/GetCachedImage. A return 870 // Helper function for implementing HasCachedImage/GetCachedImage. A return
Aaron Boodman 2012/08/15 04:05:18 Insert newline.
Bernhard Bauer 2012/08/15 19:35:09 Done.
862 // value of NULL means there is no matching image cached (we allow caching an 871 // value of NULL means there is no matching image cached (we allow caching an
863 // empty SkBitmap). 872 // empty SkBitmap).
864 SkBitmap* GetCachedImageImpl(const ExtensionResource& source, 873 SkBitmap* GetCachedImageImpl(const ExtensionResource& source,
865 const gfx::Size& max_size) const; 874 const gfx::Size& max_size) const;
866 875
867 // Helper method that loads a UserScript object from a 876 // Helper method that loads a UserScript object from a
868 // dictionary in the content_script list of the manifest. 877 // dictionary in the content_script list of the manifest.
869 bool LoadUserScriptHelper(const base::DictionaryValue* content_script, 878 bool LoadUserScriptHelper(const base::DictionaryValue* content_script,
870 int definition_index, 879 int definition_index,
871 string16* error, 880 string16* error,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 1063
1055 // A map of color names to colors. 1064 // A map of color names to colors.
1056 scoped_ptr<base::DictionaryValue> theme_colors_; 1065 scoped_ptr<base::DictionaryValue> theme_colors_;
1057 1066
1058 // A map of color names to colors. 1067 // A map of color names to colors.
1059 scoped_ptr<base::DictionaryValue> theme_tints_; 1068 scoped_ptr<base::DictionaryValue> theme_tints_;
1060 1069
1061 // A map of display properties. 1070 // A map of display properties.
1062 scoped_ptr<base::DictionaryValue> theme_display_properties_; 1071 scoped_ptr<base::DictionaryValue> theme_display_properties_;
1063 1072
1073 // A file containing a list of sites for Managed Mode.
1074 FilePath::StringType content_pack_site_list_;
1075
1064 // The homepage for this extension. Useful if it is not hosted by Google and 1076 // The homepage for this extension. Useful if it is not hosted by Google and
1065 // therefore does not have a Gallery URL. 1077 // therefore does not have a Gallery URL.
1066 GURL homepage_url_; 1078 GURL homepage_url_;
1067 1079
1068 // URL for fetching an update manifest 1080 // URL for fetching an update manifest
1069 GURL update_url_; 1081 GURL update_url_;
1070 1082
1071 // The manifest from which this extension was created. 1083 // The manifest from which this extension was created.
1072 scoped_ptr<Manifest> manifest_; 1084 scoped_ptr<Manifest> manifest_;
1073 1085
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 1196
1185 UpdatedExtensionPermissionsInfo( 1197 UpdatedExtensionPermissionsInfo(
1186 const Extension* extension, 1198 const Extension* extension,
1187 const PermissionSet* permissions, 1199 const PermissionSet* permissions,
1188 Reason reason); 1200 Reason reason);
1189 }; 1201 };
1190 1202
1191 } // namespace extensions 1203 } // namespace extensions
1192 1204
1193 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1205 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/_manifest_features.json ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698