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 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 base::DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } | 813 base::DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } |
814 base::DictionaryValue* GetThemeDisplayProperties() const { | 814 base::DictionaryValue* GetThemeDisplayProperties() const { |
815 return theme_display_properties_.get(); | 815 return theme_display_properties_.get(); |
816 } | 816 } |
817 | 817 |
818 // Content Security Policy! | 818 // Content Security Policy! |
819 const std::string& content_security_policy() const { | 819 const std::string& content_security_policy() const { |
820 return content_security_policy_; | 820 return content_security_policy_; |
821 } | 821 } |
822 | 822 |
| 823 // Content pack related. |
| 824 ExtensionResource GetContentPackSiteList() const; |
| 825 |
823 GURL GetBackgroundURL() const; | 826 GURL GetBackgroundURL() const; |
824 | 827 |
825 private: | 828 private: |
826 friend class base::RefCountedThreadSafe<Extension>; | 829 friend class base::RefCountedThreadSafe<Extension>; |
827 | 830 |
828 // We keep a cache of images loaded from extension resources based on their | 831 // We keep a cache of images loaded from extension resources based on their |
829 // path and a string representation of a size that may have been used to | 832 // path and a string representation of a size that may have been used to |
830 // scale it (or the empty string if the image is at its original size). | 833 // scale it (or the empty string if the image is at its original size). |
831 typedef std::pair<FilePath, std::string> ImageCacheKey; | 834 typedef std::pair<FilePath, std::string> ImageCacheKey; |
832 typedef std::map<ImageCacheKey, SkBitmap> ImageCache; | 835 typedef std::map<ImageCacheKey, SkBitmap> ImageCache; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 bool LoadThemeFeatures(string16* error); | 963 bool LoadThemeFeatures(string16* error); |
961 bool LoadThemeImages(const base::DictionaryValue* theme_value, | 964 bool LoadThemeImages(const base::DictionaryValue* theme_value, |
962 string16* error); | 965 string16* error); |
963 bool LoadThemeColors(const base::DictionaryValue* theme_value, | 966 bool LoadThemeColors(const base::DictionaryValue* theme_value, |
964 string16* error); | 967 string16* error); |
965 bool LoadThemeTints(const base::DictionaryValue* theme_value, | 968 bool LoadThemeTints(const base::DictionaryValue* theme_value, |
966 string16* error); | 969 string16* error); |
967 bool LoadThemeDisplayProperties(const base::DictionaryValue* theme_value, | 970 bool LoadThemeDisplayProperties(const base::DictionaryValue* theme_value, |
968 string16* error); | 971 string16* error); |
969 | 972 |
| 973 bool LoadManagedModeFeatures(string16* error); |
| 974 bool LoadManagedModeSites( |
| 975 const base::DictionaryValue* content_pack_value, |
| 976 string16* error); |
| 977 bool LoadManagedModeConfigurations( |
| 978 const base::DictionaryValue* content_pack_value, |
| 979 string16* error); |
| 980 |
970 // Helper function for implementing HasCachedImage/GetCachedImage. A return | 981 // Helper function for implementing HasCachedImage/GetCachedImage. A return |
971 // value of NULL means there is no matching image cached (we allow caching an | 982 // value of NULL means there is no matching image cached (we allow caching an |
972 // empty SkBitmap). | 983 // empty SkBitmap). |
973 SkBitmap* GetCachedImageImpl(const ExtensionResource& source, | 984 SkBitmap* GetCachedImageImpl(const ExtensionResource& source, |
974 const gfx::Size& max_size) const; | 985 const gfx::Size& max_size) const; |
975 | 986 |
976 // Helper method that loads a UserScript object from a | 987 // Helper method that loads a UserScript object from a |
977 // dictionary in the content_script list of the manifest. | 988 // dictionary in the content_script list of the manifest. |
978 bool LoadUserScriptHelper(const base::DictionaryValue* content_script, | 989 bool LoadUserScriptHelper(const base::DictionaryValue* content_script, |
979 int definition_index, | 990 int definition_index, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 | 1182 |
1172 // A map of color names to colors. | 1183 // A map of color names to colors. |
1173 scoped_ptr<base::DictionaryValue> theme_colors_; | 1184 scoped_ptr<base::DictionaryValue> theme_colors_; |
1174 | 1185 |
1175 // A map of color names to colors. | 1186 // A map of color names to colors. |
1176 scoped_ptr<base::DictionaryValue> theme_tints_; | 1187 scoped_ptr<base::DictionaryValue> theme_tints_; |
1177 | 1188 |
1178 // A map of display properties. | 1189 // A map of display properties. |
1179 scoped_ptr<base::DictionaryValue> theme_display_properties_; | 1190 scoped_ptr<base::DictionaryValue> theme_display_properties_; |
1180 | 1191 |
| 1192 // A file containing a list of sites for Managed Mode. |
| 1193 FilePath content_pack_site_list_; |
| 1194 |
1181 // The homepage for this extension. Useful if it is not hosted by Google and | 1195 // The homepage for this extension. Useful if it is not hosted by Google and |
1182 // therefore does not have a Gallery URL. | 1196 // therefore does not have a Gallery URL. |
1183 GURL homepage_url_; | 1197 GURL homepage_url_; |
1184 | 1198 |
1185 // URL for fetching an update manifest | 1199 // URL for fetching an update manifest |
1186 GURL update_url_; | 1200 GURL update_url_; |
1187 | 1201 |
1188 // The manifest from which this extension was created. | 1202 // The manifest from which this extension was created. |
1189 scoped_ptr<Manifest> manifest_; | 1203 scoped_ptr<Manifest> manifest_; |
1190 | 1204 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 | 1328 |
1315 UpdatedExtensionPermissionsInfo( | 1329 UpdatedExtensionPermissionsInfo( |
1316 const Extension* extension, | 1330 const Extension* extension, |
1317 const PermissionSet* permissions, | 1331 const PermissionSet* permissions, |
1318 Reason reason); | 1332 Reason reason); |
1319 }; | 1333 }; |
1320 | 1334 |
1321 } // namespace extensions | 1335 } // namespace extensions |
1322 | 1336 |
1323 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1337 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |