[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 5b1a0e2 | 2009-05-26 19:00:58 | [diff] [blame] | 5 | #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| 6 | #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
[email protected] | 6014d67 | 2008-12-05 00:38:25 | [diff] [blame] | 11 | #include "base/file_path.h" |
[email protected] | cc65591 | 2009-01-29 23:19:19 | [diff] [blame] | 12 | #include "base/scoped_ptr.h" |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 13 | #include "base/values.h" |
[email protected] | cc65591 | 2009-01-29 23:19:19 | [diff] [blame] | 14 | #include "base/version.h" |
[email protected] | 5b1a0e2 | 2009-05-26 19:00:58 | [diff] [blame] | 15 | #include "chrome/common/extensions/user_script.h" |
[email protected] | e2eb4311 | 2009-05-29 21:19:54 | [diff] [blame] | 16 | #include "chrome/browser/extensions/user_script_master.h" |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 17 | #include "chrome/common/extensions/url_pattern.h" |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 18 | #include "chrome/common/page_action.h" |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 19 | #include "googleurl/src/gurl.h" |
| 20 | |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 21 | // Represents a Chrome extension. |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 22 | class Extension { |
| 23 | public: |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 24 | // What an extension was loaded from. |
| 25 | enum Location { |
| 26 | INVALID, |
[email protected] | 25b3433 | 2009-06-05 21:53:19 | [diff] [blame] | 27 | INTERNAL, // A crx file from the internal Extensions directory. |
| 28 | EXTERNAL_PREF, // A crx file from an external directory (via prefs). |
| 29 | EXTERNAL_REGISTRY, // A crx file from an external directory (via eg the |
| 30 | // registry on Windows). |
| 31 | LOAD // --load-extension. |
| 32 | }; |
| 33 | |
| 34 | enum State { |
| 35 | DISABLED, |
| 36 | ENABLED, |
| 37 | KILLBIT, // Don't install/upgrade (applies to external extensions only). |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 38 | }; |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 39 | |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 40 | // An NPAPI plugin included in the extension. |
| 41 | struct PluginInfo { |
| 42 | FilePath path; // Path to the plugin. |
| 43 | bool is_public; // False if only this extension can load this plugin. |
| 44 | }; |
| 45 | |
[email protected] | 6014d67 | 2008-12-05 00:38:25 | [diff] [blame] | 46 | // The name of the manifest inside an extension. |
[email protected] | 0e29223 | 2009-01-22 15:23:34 | [diff] [blame] | 47 | static const char kManifestFilename[]; |
[email protected] | 6014d67 | 2008-12-05 00:38:25 | [diff] [blame] | 48 | |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 49 | // Keys used in JSON representation of extensions. |
[email protected] | 34aa8dc | 2009-02-19 07:03:05 | [diff] [blame] | 50 | static const wchar_t* kContentScriptsKey; |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 51 | static const wchar_t* kCssKey; |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 52 | static const wchar_t* kDescriptionKey; |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 53 | static const wchar_t* kIconPathKey; |
[email protected] | 1712232 | 2009-01-22 20:03:30 | [diff] [blame] | 54 | static const wchar_t* kIdKey; |
[email protected] | 34aa8dc | 2009-02-19 07:03:05 | [diff] [blame] | 55 | static const wchar_t* kJsKey; |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 56 | static const wchar_t* kMatchesKey; |
[email protected] | 1712232 | 2009-01-22 20:03:30 | [diff] [blame] | 57 | static const wchar_t* kNameKey; |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 58 | static const wchar_t* kPageActionsKey; |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 59 | static const wchar_t* kPermissionsKey; |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 60 | static const wchar_t* kPluginsKey; |
| 61 | static const wchar_t* kPluginsPathKey; |
| 62 | static const wchar_t* kPluginsPublicKey; |
| 63 | |
[email protected] | c6463165 | 2009-04-29 22:24:31 | [diff] [blame] | 64 | static const wchar_t* kBackgroundKey; |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 65 | static const wchar_t* kRunAtKey; |
[email protected] | 07c00d99 | 2009-03-04 20:27:04 | [diff] [blame] | 66 | static const wchar_t* kThemeKey; |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 67 | static const wchar_t* kThemeImagesKey; |
| 68 | static const wchar_t* kThemeColorsKey; |
| 69 | static const wchar_t* kThemeTintsKey; |
[email protected] | 7895ea2 | 2009-06-02 20:53:50 | [diff] [blame] | 70 | static const wchar_t* kThemeDisplayPropertiesKey; |
[email protected] | d5cef1b | 2009-03-21 05:36:49 | [diff] [blame] | 71 | static const wchar_t* kToolstripsKey; |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 72 | static const wchar_t* kTooltipKey; |
| 73 | static const wchar_t* kTypeKey; |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 74 | static const wchar_t* kVersionKey; |
| 75 | static const wchar_t* kZipHashKey; |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 76 | |
[email protected] | 0afe827 | 2009-02-14 04:15:16 | [diff] [blame] | 77 | // Some values expected in manifests. |
| 78 | static const char* kRunAtDocumentStartValue; |
| 79 | static const char* kRunAtDocumentEndValue; |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 80 | static const char* kPageActionTypeTab; |
| 81 | static const char* kPageActionTypePermanent; |
[email protected] | 0afe827 | 2009-02-14 04:15:16 | [diff] [blame] | 82 | |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 83 | // Error messages returned from InitFromValue(). |
[email protected] | 34aa8dc | 2009-02-19 07:03:05 | [diff] [blame] | 84 | static const char* kInvalidContentScriptError; |
| 85 | static const char* kInvalidContentScriptsListError; |
[email protected] | 3cfbd0e | 2009-03-18 21:26:24 | [diff] [blame] | 86 | static const char* kInvalidCssError; |
| 87 | static const char* kInvalidCssListError; |
[email protected] | 1712232 | 2009-01-22 20:03:30 | [diff] [blame] | 88 | static const char* kInvalidDescriptionError; |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 89 | static const char* kInvalidIdError; |
[email protected] | 34aa8dc | 2009-02-19 07:03:05 | [diff] [blame] | 90 | static const char* kInvalidJsError; |
| 91 | static const char* kInvalidJsListError; |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 92 | static const char* kInvalidManifestError; |
| 93 | static const char* kInvalidMatchCountError; |
| 94 | static const char* kInvalidMatchError; |
| 95 | static const char* kInvalidMatchesError; |
| 96 | static const char* kInvalidNameError; |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 97 | static const char* kInvalidPluginsError; |
| 98 | static const char* kInvalidPluginsPathError; |
| 99 | static const char* kInvalidPluginsPublicError; |
| 100 | |
[email protected] | c6463165 | 2009-04-29 22:24:31 | [diff] [blame] | 101 | static const char* kInvalidBackgroundError; |
[email protected] | 0afe827 | 2009-02-14 04:15:16 | [diff] [blame] | 102 | static const char* kInvalidRunAtError; |
[email protected] | 3cfbd0e | 2009-03-18 21:26:24 | [diff] [blame] | 103 | static const char* kInvalidToolstripError; |
[email protected] | d5cef1b | 2009-03-21 05:36:49 | [diff] [blame] | 104 | static const char* kInvalidToolstripsError; |
[email protected] | 1712232 | 2009-01-22 20:03:30 | [diff] [blame] | 105 | static const char* kInvalidVersionError; |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 106 | static const char* kInvalidPageActionError; |
| 107 | static const char* kInvalidPageActionsListError; |
| 108 | static const char* kInvalidPageActionIconPathError; |
| 109 | static const char* kInvalidPageActionTooltipError; |
| 110 | static const char* kInvalidPageActionTypeValueError; |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 111 | static const char* kInvalidPermissionsError; |
| 112 | static const char* kInvalidPermissionCountWarning; |
| 113 | static const char* kInvalidPermissionError; |
| 114 | static const char* kInvalidPermissionSchemeError; |
[email protected] | cc65591 | 2009-01-29 23:19:19 | [diff] [blame] | 115 | static const char* kInvalidZipHashError; |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 116 | static const char* kInvalidThemeError; |
| 117 | static const char* kInvalidThemeImagesMissingError; |
| 118 | static const char* kInvalidThemeImagesError; |
| 119 | static const char* kInvalidThemeColorsError; |
| 120 | static const char* kInvalidThemeTintsError; |
[email protected] | e2eb4311 | 2009-05-29 21:19:54 | [diff] [blame] | 121 | static const char* kThemesCannotContainExtensionsError; |
[email protected] | 3cfbd0e | 2009-03-18 21:26:24 | [diff] [blame] | 122 | static const char* kMissingFileError; |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 123 | |
[email protected] | 25b3433 | 2009-06-05 21:53:19 | [diff] [blame] | 124 | #if defined(OS_WIN) |
| 125 | static const char* kExtensionRegistryPath; |
| 126 | #endif |
| 127 | |
[email protected] | 37eeb5a | 2009-02-26 23:36:17 | [diff] [blame] | 128 | // The number of bytes in a legal id. |
[email protected] | fe0e782 | 2009-02-26 23:51:48 | [diff] [blame] | 129 | static const size_t kIdSize; |
[email protected] | 37eeb5a | 2009-02-26 23:36:17 | [diff] [blame] | 130 | |
[email protected] | e2eb4311 | 2009-05-29 21:19:54 | [diff] [blame] | 131 | Extension() : location_(INVALID), is_theme_(false) {} |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 132 | explicit Extension(const FilePath& path); |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 133 | virtual ~Extension(); |
| 134 | |
[email protected] | 25b3433 | 2009-06-05 21:53:19 | [diff] [blame] | 135 | // Checks to see if the extension has a valid ID. |
| 136 | static bool IdIsValid(const std::string& id); |
| 137 | |
| 138 | // Whether the |location| is external or not. |
| 139 | static inline bool IsExternalLocation(Location location) { |
| 140 | return location == Extension::EXTERNAL_PREF || |
| 141 | location == Extension::EXTERNAL_REGISTRY; |
| 142 | } |
| 143 | |
[email protected] | 07c00d99 | 2009-03-04 20:27:04 | [diff] [blame] | 144 | // Returns an absolute url to a resource inside of an extension. The |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 145 | // |extension_url| argument should be the url() from an Extension object. The |
| 146 | // |relative_path| can be untrusted user input. The returned URL will either |
| 147 | // be invalid() or a child of |extension_url|. |
| 148 | // NOTE: Static so that it can be used from multiple threads. |
| 149 | static GURL GetResourceURL(const GURL& extension_url, |
| 150 | const std::string& relative_path); |
[email protected] | 3cfbd0e | 2009-03-18 21:26:24 | [diff] [blame] | 151 | GURL GetResourceURL(const std::string& relative_path) { |
| 152 | return GetResourceURL(url(), relative_path); |
| 153 | } |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 154 | |
[email protected] | 07c00d99 | 2009-03-04 20:27:04 | [diff] [blame] | 155 | // Returns an absolute path to a resource inside of an extension. The |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 156 | // |extension_path| argument should be the path() from an Extension object. |
| 157 | // The |relative_path| can be untrusted user input. The returned path will |
| 158 | // either be empty or a child of extension_path. |
| 159 | // NOTE: Static so that it can be used from multiple threads. |
| 160 | static FilePath GetResourcePath(const FilePath& extension_path, |
| 161 | const std::string& relative_path); |
[email protected] | 3cfbd0e | 2009-03-18 21:26:24 | [diff] [blame] | 162 | FilePath GetResourcePath(const std::string& relative_path) { |
| 163 | return GetResourcePath(path(), relative_path); |
| 164 | } |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 165 | |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 166 | // Initialize the extension from a parsed manifest. |
[email protected] | 5bfb1eb0a | 2009-04-08 18:33:30 | [diff] [blame] | 167 | // If |require_id| is true, will return an error if the "id" key is missing |
| 168 | // from the value. |
| 169 | bool InitFromValue(const DictionaryValue& value, bool require_id, |
| 170 | std::string* error); |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 171 | |
[email protected] | 8289126 | 2008-12-24 00:21:26 | [diff] [blame] | 172 | const FilePath& path() const { return path_; } |
[email protected] | 5bfb1eb0a | 2009-04-08 18:33:30 | [diff] [blame] | 173 | const GURL& url() const { return extension_url_; } |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 174 | const Location location() const { return location_; } |
| 175 | void set_location(Location location) { location_ = location; } |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 176 | const std::string& id() const { return id_; } |
| 177 | const Version* version() const { return version_.get(); } |
| 178 | // String representation of the version number. |
| 179 | const std::string VersionString() const; |
| 180 | const std::string& name() const { return name_; } |
| 181 | const std::string& description() const { return description_; } |
| 182 | const UserScriptList& content_scripts() const { return content_scripts_; } |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 183 | const PageActionMap& page_actions() const { return page_actions_; } |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 184 | const std::vector<PluginInfo>& plugins() const { return plugins_; } |
[email protected] | c6463165 | 2009-04-29 22:24:31 | [diff] [blame] | 185 | const GURL& background_url() const { return background_url_; } |
[email protected] | d5cef1b | 2009-03-21 05:36:49 | [diff] [blame] | 186 | const std::vector<std::string>& toolstrips() const { return toolstrips_; } |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 187 | const std::vector<URLPattern>& permissions() const { return permissions_; } |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 188 | |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 189 | // Retrieves a page action by |id|. |
| 190 | const PageAction* GetPageAction(std::string id) const; |
| 191 | |
[email protected] | 25b3433 | 2009-06-05 21:53:19 | [diff] [blame] | 192 | // Returns the origin of this extension. This function takes a |registry_path| |
| 193 | // so that the registry location can be overwritten during testing. |
| 194 | Location ExternalExtensionInstallType(std::string registry_path); |
| 195 | |
| 196 | // Theme-related. |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 197 | DictionaryValue* GetThemeImages() const { return theme_images_.get(); } |
| 198 | DictionaryValue* GetThemeColors() const { return theme_colors_.get(); } |
| 199 | DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } |
[email protected] | 7895ea2 | 2009-06-02 20:53:50 | [diff] [blame] | 200 | DictionaryValue* GetThemeDisplayProperties() const { |
| 201 | return theme_display_properties_.get(); |
| 202 | } |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 203 | bool IsTheme() { return is_theme_; } |
| 204 | |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 205 | private: |
[email protected] | 3cfbd0e | 2009-03-18 21:26:24 | [diff] [blame] | 206 | // Helper method that loads a UserScript object from a |
| 207 | // dictionary in the content_script list of the manifest. |
| 208 | bool LoadUserScriptHelper(const DictionaryValue* content_script, |
| 209 | int definition_index, |
| 210 | std::string* error, |
| 211 | UserScript* result); |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 212 | |
| 213 | // Helper method that loads a PageAction object from a |
| 214 | // dictionary in the page_action list of the manifest. |
[email protected] | ce5c450 | 2009-05-06 16:46:11 | [diff] [blame] | 215 | PageAction* LoadPageActionHelper(const DictionaryValue* page_action, |
| 216 | int definition_index, |
| 217 | std::string* error); |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 218 | |
[email protected] | e2eb4311 | 2009-05-29 21:19:54 | [diff] [blame] | 219 | // Figures out if a source contains keys not associated with themes - we |
| 220 | // don't want to allow scripts and such to be bundled with themes. |
| 221 | bool ContainsNonThemeKeys(const DictionaryValue& source); |
| 222 | |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 223 | // The absolute path to the directory the extension is stored in. |
| 224 | FilePath path_; |
| 225 | |
| 226 | // The base extension url for the extension. |
| 227 | GURL extension_url_; |
[email protected] | eab9b45 | 2009-01-23 20:48:59 | [diff] [blame] | 228 | |
[email protected] | 631cf82 | 2009-05-15 07:01:25 | [diff] [blame] | 229 | // The location the extension was loaded from. |
| 230 | Location location_; |
| 231 | |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 232 | // A human-readable ID for the extension. The convention is to use something |
| 233 | // like 'com.example.myextension', but this is not currently enforced. An |
| 234 | // extension's ID is used in things like directory structures and URLs, and |
| 235 | // is expected to not change across versions. In the case of conflicts, |
| 236 | // updates will only be allowed if the extension can be validated using the |
| 237 | // previous version's update key. |
[email protected] | e1cec06c | 2008-12-18 01:22:23 | [diff] [blame] | 238 | std::string id_; |
[email protected] | 8289126 | 2008-12-24 00:21:26 | [diff] [blame] | 239 | |
[email protected] | 64a02b80 | 2009-01-12 19:36:42 | [diff] [blame] | 240 | // The extension's version. |
[email protected] | cc65591 | 2009-01-29 23:19:19 | [diff] [blame] | 241 | scoped_ptr<Version> version_; |
[email protected] | 64a02b80 | 2009-01-12 19:36:42 | [diff] [blame] | 242 | |
[email protected] | 8289126 | 2008-12-24 00:21:26 | [diff] [blame] | 243 | // The extension's human-readable name. |
[email protected] | e1cec06c | 2008-12-18 01:22:23 | [diff] [blame] | 244 | std::string name_; |
[email protected] | 8289126 | 2008-12-24 00:21:26 | [diff] [blame] | 245 | |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 246 | // An optional longer description of the extension. |
[email protected] | e1cec06c | 2008-12-18 01:22:23 | [diff] [blame] | 247 | std::string description_; |
[email protected] | 8289126 | 2008-12-24 00:21:26 | [diff] [blame] | 248 | |
| 249 | // Paths to the content scripts the extension contains. |
[email protected] | 34aa8dc | 2009-02-19 07:03:05 | [diff] [blame] | 250 | UserScriptList content_scripts_; |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 251 | |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 252 | // A list of page actions. |
| 253 | PageActionMap page_actions_; |
| 254 | |
[email protected] | c533bb2 | 2009-06-03 19:06:11 | [diff] [blame] | 255 | // Optional list of NPAPI plugins and associated properties. |
| 256 | std::vector<PluginInfo> plugins_; |
[email protected] | 367230c5 | 2009-02-21 01:44:30 | [diff] [blame] | 257 | |
[email protected] | c6463165 | 2009-04-29 22:24:31 | [diff] [blame] | 258 | // Optional URL to a master page of which a single instance should be always |
| 259 | // loaded in the background. |
| 260 | GURL background_url_; |
| 261 | |
[email protected] | d5cef1b | 2009-03-21 05:36:49 | [diff] [blame] | 262 | // Paths to HTML files to be displayed in the toolbar. |
| 263 | std::vector<std::string> toolstrips_; |
[email protected] | 4a8d327 | 2009-03-10 19:15:08 | [diff] [blame] | 264 | |
[email protected] | cc65591 | 2009-01-29 23:19:19 | [diff] [blame] | 265 | // A SHA1 hash of the contents of the zip file. Note that this key is only |
| 266 | // present in the manifest that's prepended to the zip. The inner manifest |
| 267 | // will not have this key. |
| 268 | std::string zip_hash_; |
| 269 | |
[email protected] | 07c00d99 | 2009-03-04 20:27:04 | [diff] [blame] | 270 | // A map of resource id's to relative file paths. |
[email protected] | bbb436f | 2009-05-09 16:51:07 | [diff] [blame] | 271 | scoped_ptr<DictionaryValue> theme_images_; |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 272 | |
| 273 | // A map of color names to colors. |
[email protected] | bbb436f | 2009-05-09 16:51:07 | [diff] [blame] | 274 | scoped_ptr<DictionaryValue> theme_colors_; |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 275 | |
| 276 | // A map of color names to colors. |
[email protected] | bbb436f | 2009-05-09 16:51:07 | [diff] [blame] | 277 | scoped_ptr<DictionaryValue> theme_tints_; |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 278 | |
[email protected] | 7895ea2 | 2009-06-02 20:53:50 | [diff] [blame] | 279 | // A map of display properties. |
| 280 | scoped_ptr<DictionaryValue> theme_display_properties_; |
| 281 | |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 282 | // Whether the extension is a theme - if it is, certain things are disabled. |
| 283 | bool is_theme_; |
[email protected] | 07c00d99 | 2009-03-04 20:27:04 | [diff] [blame] | 284 | |
[email protected] | c6463165 | 2009-04-29 22:24:31 | [diff] [blame] | 285 | // The sites this extension has permission to talk to (using XHR, etc). |
[email protected] | 7197f499 | 2009-03-23 05:05:49 | [diff] [blame] | 286 | std::vector<URLPattern> permissions_; |
| 287 | |
[email protected] | 894bb50 | 2009-05-21 22:39:57 | [diff] [blame] | 288 | DISALLOW_COPY_AND_ASSIGN(Extension); |
[email protected] | 7713d63 | 2008-12-02 07:52:33 | [diff] [blame] | 289 | }; |
| 290 | |
[email protected] | 5b1a0e2 | 2009-05-26 19:00:58 | [diff] [blame] | 291 | #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |