blob: d6d41736b96157f67e18ac0ccbfdf623c017f3a4 [file] [log] [blame]
[email protected]3b63f8f42011-03-28 01:54:151// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]7713d632008-12-02 07:52:332// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]5b1a0e22009-05-26 19:00:585#ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
6#define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
[email protected]7713d632008-12-02 07:52:338
[email protected]300cc58db2009-08-19 20:45:149#include <map>
[email protected]facd7a7652009-06-05 23:15:0210#include <set>
[email protected]7713d632008-12-02 07:52:3311#include <string>
12#include <vector>
13
[email protected]6014d672008-12-05 00:38:2514#include "base/file_path.h"
[email protected]19118d52010-07-26 22:13:4215#include "base/gtest_prod_util.h"
[email protected]3b63f8f42011-03-28 01:54:1516#include "base/memory/ref_counted.h"
17#include "base/memory/scoped_ptr.h"
[email protected]d83a5602010-09-16 00:22:4818#include "chrome/common/extensions/extension_constants.h"
[email protected]867a73e12010-03-19 20:45:4619#include "chrome/common/extensions/extension_extent.h"
[email protected]807871f2010-09-16 01:04:4820#include "chrome/common/extensions/extension_icon_set.h"
[email protected]42b6f0f82009-09-18 21:07:3921#include "chrome/common/extensions/user_script.h"
[email protected]7197f4992009-03-23 05:05:4922#include "chrome/common/extensions/url_pattern.h"
[email protected]eab9b452009-01-23 20:48:5923#include "googleurl/src/gurl.h"
[email protected]08397d52011-02-05 01:53:3824#include "ui/gfx/size.h"
[email protected]eab9b452009-01-23 20:48:5925
[email protected]3bb84992010-08-26 17:23:4626class DictionaryValue;
[email protected]942690b132010-05-11 06:42:1427class ExtensionAction;
28class ExtensionResource;
[email protected]e2dffe02011-01-20 20:30:0629class ExtensionSidebarDefaults;
[email protected]12802702010-07-09 19:43:0930class SkBitmap;
[email protected]daf66aa2010-08-06 06:24:2831class Version;
[email protected]942690b132010-05-11 06:42:1432
[email protected]f0755532010-06-22 07:27:2533// Represents a Chrome extension.
[email protected]66e4eb32010-10-27 20:37:4134class Extension : public base::RefCountedThreadSafe<Extension> {
[email protected]7713d632008-12-02 07:52:3335 public:
[email protected]d3cfa482009-10-17 13:54:5736 typedef std::map<const std::string, GURL> URLOverrideMap;
[email protected]10fb1992010-10-08 09:00:1737 typedef std::vector<std::string> ScriptingWhitelist;
[email protected]b24d8312009-08-27 06:47:4638
[email protected]631cf822009-05-15 07:01:2539 // What an extension was loaded from.
[email protected]9b217652010-10-08 22:04:2340 // NOTE: These values are stored as integers in the preferences and used
41 // in histograms so don't remove or reorder existing items. Just append
42 // to the end.
[email protected]631cf822009-05-15 07:01:2543 enum Location {
44 INVALID,
[email protected]25b34332009-06-05 21:53:1945 INTERNAL, // A crx file from the internal Extensions directory.
46 EXTERNAL_PREF, // A crx file from an external directory (via prefs).
47 EXTERNAL_REGISTRY, // A crx file from an external directory (via eg the
48 // registry on Windows).
[email protected]1952c7d2010-03-04 23:48:3449 LOAD, // --load-extension.
[email protected]8ef78fd2010-08-19 17:14:3250 COMPONENT, // An integral component of Chrome itself, which
51 // happens to be implemented as an extension. We don't
52 // show these in the management UI.
[email protected]4d2913e32010-11-30 00:28:5553 EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via
54 // prefs), installed from an update URL.
55 EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via
56 // admin policies), installed from an update URL.
[email protected]04cb7542010-10-25 10:50:0657
58 NUM_LOCATIONS
[email protected]25b34332009-06-05 21:53:1959 };
60
61 enum State {
[email protected]0c6da502009-08-14 22:32:3962 DISABLED = 0,
[email protected]25b34332009-06-05 21:53:1963 ENABLED,
[email protected]79c833b52011-04-05 18:31:0164 // An external extension that the user uninstalled. We should not reinstall
65 // such extensions on startup.
66 EXTERNAL_EXTENSION_UNINSTALLED,
[email protected]0c6da502009-08-14 22:32:3967 NUM_STATES
[email protected]631cf822009-05-15 07:01:2568 };
[email protected]7713d632008-12-02 07:52:3369
[email protected]fbcc40302009-06-12 20:45:4570 enum InstallType {
[email protected]ab6f2b22009-07-28 23:28:3771 INSTALL_ERROR,
[email protected]fbcc40302009-06-12 20:45:4572 DOWNGRADE,
73 REINSTALL,
74 UPGRADE,
75 NEW_INSTALL
76 };
77
[email protected]d2817012009-08-04 06:46:2178 // NOTE: If you change this list, you should also change kIconSizes in the cc
79 // file.
80 enum Icons {
81 EXTENSION_ICON_LARGE = 128,
82 EXTENSION_ICON_MEDIUM = 48,
83 EXTENSION_ICON_SMALL = 32,
[email protected]39382942010-03-23 15:57:0984 EXTENSION_ICON_SMALLISH = 24,
[email protected]d2817012009-08-04 06:46:2185 EXTENSION_ICON_BITTY = 16,
86 };
87
[email protected]7fa19f82010-12-21 19:40:0888 // Do not change the order of entries or remove entries in this list
89 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions.
90 enum Type {
[email protected]9b217652010-10-08 22:04:2391 TYPE_UNKNOWN = 0,
92 TYPE_EXTENSION,
93 TYPE_THEME,
94 TYPE_USER_SCRIPT,
95 TYPE_HOSTED_APP,
96 TYPE_PACKAGED_APP
97 };
98
[email protected]92888082010-10-18 19:24:5799 // An NPAPI plugin included in the extension.
100 struct PluginInfo {
101 FilePath path; // Path to the plugin.
102 bool is_public; // False if only this extension can load this plugin.
103 };
104
[email protected]a4a38c12010-12-23 16:43:56105 struct TtsVoice {
106 std::string voice_name;
107 std::string locale;
108 std::string gender;
109 };
110
[email protected]0df165f2010-09-28 16:49:40111 // A permission is defined by its |name| (what is used in the manifest),
112 // and the |message_id| that's used by install/update UI.
113 struct Permission {
114 const char* const name;
115 const int message_id;
116 };
117
[email protected]83048a22011-03-29 00:14:13118 enum InitFromValueFlags {
119 NO_FLAGS = 0,
120
121 // Usually, the id of an extension is generated by the "key" property of
122 // its manifest, but if |REQUIRE_KEY| is not set, a temporary ID will be
123 // generated based on the path.
124 REQUIRE_KEY = 1 << 0,
125
126 // |STRICT_ERROR_CHECKS| enables extra error checking, such as
127 // checks that URL patterns do not contain ports. This error
128 // checking may find an error that a previous version of
129 // Chrome did not flag. To avoid errors in installed extensions
130 // when Chrome is upgraded, strict error checking is only enabled
131 // when loading extensions as a developer would (such as loading
132 // an unpacked extension), or when loading an extension that is
133 // tied to a specific version of Chrome (such as a component
134 // extension). Most callers will set the |STRICT_ERROR_CHECKS| bit when
135 // Extension::ShouldDoStrictErrorChecking(location) returns true.
136 STRICT_ERROR_CHECKS = 1 << 1,
[email protected]3aff9ad2011-04-01 20:26:48137
138 // |ALLOW_FILE_ACCESS| indicates that the user is allowing this extension
139 // to have file access. If it's not present, then permissions and content
140 // scripts that match file:/// URLs will be filtered out.
141 ALLOW_FILE_ACCESS = 1 << 2,
[email protected]83048a22011-03-29 00:14:13142 };
143
[email protected]66e4eb32010-10-27 20:37:41144 static scoped_refptr<Extension> Create(const FilePath& path,
145 Location location,
146 const DictionaryValue& value,
[email protected]83048a22011-03-29 00:14:13147 int flags,
[email protected]66e4eb32010-10-27 20:37:41148 std::string* error);
149
[email protected]4d2913e32010-11-30 00:28:55150 // Return the update url used by gallery/webstore extensions.
151 static GURL GalleryUpdateUrl(bool secure);
152
[email protected]0df165f2010-09-28 16:49:40153 // The install message id for |permission|. Returns 0 if none exists.
154 static int GetPermissionMessageId(const std::string& permission);
155
[email protected]a2a098d2010-09-29 19:42:55156 // Returns the full list of permission messages that this extension
157 // should display at install time.
[email protected]9adb9692010-10-29 23:14:02158 std::vector<string16> GetPermissionMessages() const;
[email protected]a2a098d2010-09-29 19:42:55159
[email protected]d6a5c78c2010-12-07 05:18:15160 // Returns the distinct hosts that should be displayed in the install UI
161 // for the URL patterns |list|. This discards some of the detail that is
162 // present in the manifest to make it as easy as possible to process by
163 // users. In particular we disregard the scheme and path components of
164 // URLPatterns and de-dupe the result, which includes filtering out common
[email protected]d7d4a402011-03-08 18:27:51165 // hosts with differing RCDs (aka Registry Controlled Domains, most of which
166 // are Top Level Domains but also include exceptions like co.uk).
167 // NOTE: when de-duping hosts the preferred RCD will be returned, given this
168 // order of preference: .com, .net, .org, first in list.
[email protected]d6a5c78c2010-12-07 05:18:15169 static std::vector<std::string> GetDistinctHostsForDisplay(
170 const URLPatternList& list);
171
172 // Compares two URLPatternLists for security equality by returning whether
173 // the URL patterns in |new_list| contain additional distinct hosts compared
174 // to |old_list|.
175 static bool IsElevatedHostList(
176 const URLPatternList& old_list, const URLPatternList& new_list);
[email protected]0df165f2010-09-28 16:49:40177
[email protected]c3e3def742009-07-17 07:51:06178 // Icon sizes used by the extension system.
[email protected]d2817012009-08-04 06:46:21179 static const int kIconSizes[];
[email protected]c3e3def742009-07-17 07:51:06180
[email protected]4c4f8192009-10-17 01:03:26181 // Max size (both dimensions) for browser and page actions.
182 static const int kPageActionIconMaxSize;
183 static const int kBrowserActionIconMaxSize;
[email protected]e2dffe02011-01-20 20:30:06184 static const int kSidebarIconMaxSize;
[email protected]4c4f8192009-10-17 01:03:26185
[email protected]35506352009-08-07 18:58:19186 // Each permission is a module that the extension is permitted to use.
[email protected]218990c2010-06-26 01:21:07187 //
[email protected]0df165f2010-09-28 16:49:40188 // NOTE: To add a new permission, define it here, and add an entry to
189 // Extension::kPermissions.
[email protected]9dcf8f12010-09-02 20:39:19190 static const char kBackgroundPermission[];
191 static const char kBookmarkPermission[];
[email protected]598bbcc2011-02-24 10:03:25192 static const char kContentSettingsPermission[];
[email protected]9dcf8f12010-09-02 20:39:19193 static const char kContextMenusPermission[];
194 static const char kCookiePermission[];
[email protected]61b55b62011-03-24 09:03:10195 static const char kChromeosInfoPrivatePermissions[];
[email protected]91ba3312011-03-17 20:39:22196 static const char kDebuggerPermission[];
[email protected]9dcf8f12010-09-02 20:39:19197 static const char kExperimentalPermission[];
[email protected]55d9bed2011-03-25 20:37:59198 static const char kFileSystemPermission[];
199 static const char kFileBrowserPrivatePermission[];
[email protected]9dcf8f12010-09-02 20:39:19200 static const char kGeolocationPermission[];
201 static const char kHistoryPermission[];
202 static const char kIdlePermission[];
[email protected]eb255772010-10-04 22:10:46203 static const char kManagementPermission[];
[email protected]9dcf8f12010-09-02 20:39:19204 static const char kNotificationPermission[];
205 static const char kProxyPermission[];
206 static const char kTabPermission[];
207 static const char kUnlimitedStoragePermission[];
[email protected]9dcf8f12010-09-02 20:39:19208 static const char kWebstorePrivatePermission[];
[email protected]aeb53b32009-10-29 07:34:45209
[email protected]0df165f2010-09-28 16:49:40210 static const Permission kPermissions[];
[email protected]35506352009-08-07 18:58:19211 static const size_t kNumPermissions;
[email protected]9dcf8f12010-09-02 20:39:19212 static const char* const kHostedAppPermissionNames[];
[email protected]b746f372010-08-29 21:39:32213 static const size_t kNumHostedAppPermissions;
[email protected]35506352009-08-07 18:58:19214
[email protected]03b612f2010-08-13 21:09:21215 // The old name for the unlimited storage permission, which is deprecated but
216 // still accepted as meaning the same thing as kUnlimitedStoragePermission.
[email protected]9dcf8f12010-09-02 20:39:19217 static const char kOldUnlimitedStoragePermission[];
[email protected]03b612f2010-08-13 21:09:21218
[email protected]8d888c12010-11-30 00:00:25219 // Valid schemes for web extent URLPatterns.
220 static const int kValidWebExtentSchemes;
221
[email protected]f71f7e62010-12-07 03:45:33222 // Valid schemes for host permission URLPatterns.
223 static const int kValidHostPermissionSchemes;
224
[email protected]b746f372010-08-29 21:39:32225 // Returns true if the string is one of the known hosted app permissions (see
226 // kHostedAppPermissionNames).
227 static bool IsHostedAppPermission(const std::string& permission);
228
[email protected]6014d672008-12-05 00:38:25229 // The name of the manifest inside an extension.
[email protected]99efb7b12009-12-18 02:39:16230 static const FilePath::CharType kManifestFilename[];
[email protected]6014d672008-12-05 00:38:25231
[email protected]300cc58db2009-08-19 20:45:14232 // The name of locale folder inside an extension.
[email protected]99efb7b12009-12-18 02:39:16233 static const FilePath::CharType kLocaleFolder[];
[email protected]300cc58db2009-08-19 20:45:14234
235 // The name of the messages file inside an extension.
[email protected]99efb7b12009-12-18 02:39:16236 static const FilePath::CharType kMessagesFilename[];
[email protected]300cc58db2009-08-19 20:45:14237
[email protected]25b34332009-06-05 21:53:19238#if defined(OS_WIN)
[email protected]9dcf8f12010-09-02 20:39:19239 static const char kExtensionRegistryPath[];
[email protected]25b34332009-06-05 21:53:19240#endif
241
[email protected]37eeb5a2009-02-26 23:36:17242 // The number of bytes in a legal id.
[email protected]fe0e7822009-02-26 23:51:48243 static const size_t kIdSize;
[email protected]37eeb5a2009-02-26 23:36:17244
[email protected]e435d6b72009-07-25 03:15:58245 // The mimetype used for extensions.
246 static const char kMimeType[];
247
[email protected]25b34332009-06-05 21:53:19248 // Checks to see if the extension has a valid ID.
249 static bool IdIsValid(const std::string& id);
250
[email protected]4ead6f72010-10-13 19:54:18251 // Generate an ID for an extension in the given path.
[email protected]28d7479b2011-03-09 21:33:27252 // Used while developing extensions, before they have a key.
[email protected]4ead6f72010-10-13 19:54:18253 static std::string GenerateIdForPath(const FilePath& file_name);
254
[email protected]e435d6b72009-07-25 03:15:58255 // Returns true if the specified file is an extension.
256 static bool IsExtension(const FilePath& file_name);
257
[email protected]25b34332009-06-05 21:53:19258 // Whether the |location| is external or not.
259 static inline bool IsExternalLocation(Location location) {
260 return location == Extension::EXTERNAL_PREF ||
[email protected]8ef78fd2010-08-19 17:14:32261 location == Extension::EXTERNAL_REGISTRY ||
[email protected]04cb7542010-10-25 10:50:06262 location == Extension::EXTERNAL_PREF_DOWNLOAD ||
263 location == Extension::EXTERNAL_POLICY_DOWNLOAD;
264 }
265
266 // Whether extensions with |location| are auto-updatable or not.
267 static inline bool IsAutoUpdateableLocation(Location location) {
268 // Only internal and external extensions can be autoupdated.
269 return location == Extension::INTERNAL ||
270 IsExternalLocation(location);
[email protected]25b34332009-06-05 21:53:19271 }
272
[email protected]95da88c42011-03-31 10:07:33273 // Whether extensions with |location| can be uninstalled or not. Policy
274 // controlled extensions are silently auto-installed and updated, and cannot
275 // be disabled by the user. The same applies for internal components.
276 static inline bool UserMayDisable(Location location) {
277 return location != Extension::EXTERNAL_POLICY_DOWNLOAD &&
278 location != Extension::COMPONENT;
279 }
280
[email protected]542258c2011-03-04 21:25:31281 // Whether extensions with |location| should be loaded with strict
282 // error checking. Strict error checks may flag errors older versions
283 // of chrome did not detect. To avoid breaking installed extensions,
284 // strict checks are disabled unless the location indicates that the
285 // developer is loading the extension, or the extension is a component
286 // of chrome.
287 static inline bool ShouldDoStrictErrorChecking(Location location) {
288 return location == Extension::LOAD ||
289 location == Extension::COMPONENT;
290 }
291
[email protected]3aff9ad2011-04-01 20:26:48292 // Unpacked extensions start off with file access since they are a developer
293 // feature.
294 static inline bool ShouldAlwaysAllowFileAccess(Location location) {
295 return location == Extension::LOAD;
296 }
297
[email protected]7fa19f82010-12-21 19:40:08298 // See Type definition above.
299 Type GetType() const;
[email protected]9b217652010-10-08 22:04:23300
[email protected]07c00d992009-03-04 20:27:04301 // Returns an absolute url to a resource inside of an extension. The
[email protected]eab9b452009-01-23 20:48:59302 // |extension_url| argument should be the url() from an Extension object. The
303 // |relative_path| can be untrusted user input. The returned URL will either
304 // be invalid() or a child of |extension_url|.
305 // NOTE: Static so that it can be used from multiple threads.
306 static GURL GetResourceURL(const GURL& extension_url,
307 const std::string& relative_path);
[email protected]cffd7892010-08-26 17:43:28308 GURL GetResourceURL(const std::string& relative_path) const {
[email protected]3cfbd0e2009-03-18 21:26:24309 return GetResourceURL(url(), relative_path);
310 }
[email protected]eab9b452009-01-23 20:48:59311
[email protected]99efb7b12009-12-18 02:39:16312 // Returns an extension resource object. |relative_path| should be UTF8
313 // encoded.
[email protected]9adb9692010-10-29 23:14:02314 ExtensionResource GetResource(const std::string& relative_path) const;
[email protected]99efb7b12009-12-18 02:39:16315
316 // As above, but with |relative_path| following the file system's encoding.
[email protected]9adb9692010-10-29 23:14:02317 ExtensionResource GetResource(const FilePath& relative_path) const;
[email protected]eab9b452009-01-23 20:48:59318
[email protected]a17f9462009-06-09 02:56:41319 // |input| is expected to be the text of an rsa public or private key. It
320 // tolerates the presence or absence of bracking header/footer like this:
321 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY-----
322 // and may contain newlines.
323 static bool ParsePEMKeyBytes(const std::string& input, std::string* output);
324
325 // Does a simple base64 encoding of |input| into |output|.
326 static bool ProducePEM(const std::string& input, std::string* output);
327
[email protected]84ac7f32009-10-06 06:17:54328 // Generates an extension ID from arbitrary input. The same input string will
329 // always generate the same output ID.
330 static bool GenerateId(const std::string& input, std::string* output);
[email protected]fbcc40302009-06-12 20:45:45331
[email protected]a17f9462009-06-09 02:56:41332 // Expects base64 encoded |input| and formats into |output| including
333 // the appropriate header & footer.
[email protected]e0d08192011-03-29 19:02:50334 static bool FormatPEMForFileOutput(const std::string& input,
335 std::string* output,
336 bool is_public);
[email protected]a17f9462009-06-09 02:56:41337
[email protected]2a409532009-08-28 19:39:44338 // Determine whether |new_extension| has increased privileges compared to
[email protected]8d888c12010-11-30 00:00:25339 // its previously granted permissions, specified by |granted_apis|,
340 // |granted_extent| and |granted_full_access|.
341 static bool IsPrivilegeIncrease(const bool granted_full_access,
342 const std::set<std::string>& granted_apis,
343 const ExtensionExtent& granted_extent,
[email protected]9adb9692010-10-29 23:14:02344 const Extension* new_extension);
[email protected]b24d8312009-08-27 06:47:46345
[email protected]c690a9812009-12-17 05:55:32346 // Given an extension and icon size, read it if present and decode it into
[email protected]ae2e0f92010-04-06 20:32:23347 // result. In the browser process, this will DCHECK if not called on the
348 // file thread. To easily load extension images on the UI thread, see
349 // ImageLoadingTracker.
[email protected]9adb9692010-10-29 23:14:02350 static void DecodeIcon(const Extension* extension,
[email protected]c690a9812009-12-17 05:55:32351 Icons icon_size,
352 scoped_ptr<SkBitmap>* result);
353
354 // Given an icon_path and icon size, read it if present and decode it into
[email protected]ae2e0f92010-04-06 20:32:23355 // result. In the browser process, this will DCHECK if not called on the
356 // file thread. To easily load extension images on the UI thread, see
357 // ImageLoadingTracker.
[email protected]c690a9812009-12-17 05:55:32358 static void DecodeIconFromPath(const FilePath& icon_path,
359 Icons icon_size,
360 scoped_ptr<SkBitmap>* result);
361
[email protected]a807bbe2010-04-14 10:51:19362 // Returns the base extension url for a given |extension_id|.
363 static GURL GetBaseURLFromExtensionId(const std::string& extension_id);
364
[email protected]ec5b50d2010-10-09 16:35:18365 // Returns the url prefix for the extension/apps gallery. Can be set via the
[email protected]ce3eb7b62010-09-14 13:57:44366 // --apps-gallery-url switch. The URL returned will not contain a trailing
[email protected]d3071992010-10-08 15:24:07367 // slash. Do not use this as a prefix/extent for the store. Instead see
[email protected]eaa7dd182010-12-14 11:09:00368 // ExtensionService::GetWebStoreApp or
369 // ExtensionService::IsDownloadFromGallery
[email protected]d3071992010-10-08 15:24:07370 static std::string ChromeStoreLaunchURL();
[email protected]a0cf04a2010-06-23 03:29:55371
[email protected]be7e5cb2010-10-04 12:53:17372 // Adds an extension to the scripting whitelist. Used for testing only.
[email protected]10fb1992010-10-08 09:00:17373 static void SetScriptingWhitelist(const ScriptingWhitelist& whitelist);
[email protected]2a521c52011-01-26 18:45:21374 static const ScriptingWhitelist* GetScriptingWhitelist();
[email protected]be7e5cb2010-10-04 12:53:17375
[email protected]aeb53b32009-10-29 07:34:45376 // Returns true if the extension has the specified API permission.
[email protected]0df165f2010-09-28 16:49:40377 static bool HasApiPermission(const std::set<std::string>& api_permissions,
[email protected]246c05f2010-09-10 09:12:11378 const std::string& function_name);
[email protected]583d45c12010-08-31 02:48:12379
[email protected]8d888c12010-11-30 00:00:25380 // Whether the |effective_host_permissions| and |api_permissions| include
381 // effective access to all hosts. See the non-static version of the method
382 // for more details.
383 static bool HasEffectiveAccessToAllHosts(
384 const ExtensionExtent& effective_host_permissions,
385 const std::set<std::string>& api_permissions);
386
[email protected]246c05f2010-09-10 09:12:11387 bool HasApiPermission(const std::string& function_name) const {
388 return HasApiPermission(this->api_permissions(), function_name);
[email protected]aeb53b32009-10-29 07:34:45389 }
390
[email protected]4361c7c2010-09-30 21:57:53391 const ExtensionExtent& GetEffectiveHostPermissions() const {
[email protected]6f229e82010-11-02 17:47:26392 return effective_host_permissions_;
[email protected]4361c7c2010-09-30 21:57:53393 }
[email protected]b24d8312009-08-27 06:47:46394
[email protected]fbd17cf2010-04-28 23:52:56395 // Whether or not the extension is allowed permission for a URL pattern from
396 // the manifest. http, https, and chrome://favicon/ is allowed for all
397 // extensions, while component extensions are allowed access to
398 // chrome://resources.
[email protected]a3caa822010-10-26 18:10:00399 bool CanSpecifyHostPermission(const URLPattern& pattern) const;
[email protected]fbd17cf2010-04-28 23:52:56400
[email protected]584b8e3f2010-04-10 00:23:37401 // Whether the extension has access to the given URL.
402 bool HasHostPermission(const GURL& url) const;
403
[email protected]0df165f2010-09-28 16:49:40404 // Whether the extension has effective access to all hosts. This is true if
405 // there is a content script that matches all hosts, if there is a host
406 // permission grants access to all hosts (like <all_urls>) or an api
407 // permission that effectively grants access to all hosts (e.g. proxy,
408 // network, etc.)
409 bool HasEffectiveAccessToAllHosts() const;
[email protected]b24d8312009-08-27 06:47:46410
[email protected]8d888c12010-11-30 00:00:25411 // Whether the extension effectively has all permissions (for example, by
412 // having an NPAPI plugin).
413 bool HasFullPermissions() const;
414
[email protected]5df6a5d2011-01-26 07:39:12415 // Whether context menu should be shown for page and browser actions.
416 bool ShowConfigureContextMenus() const;
417
[email protected]37cd64d2010-10-25 18:17:58418 // Returns the Homepage URL for this extension. If homepage_url was not
419 // specified in the manifest, this returns the Google Gallery URL. For
[email protected]bfa90a3a2010-04-28 15:43:23420 // third-party extensions, this returns a blank GURL.
[email protected]37cd64d2010-10-25 18:17:58421 GURL GetHomepageURL() const;
[email protected]bfa90a3a2010-04-28 15:43:23422
[email protected]facd7a7652009-06-05 23:15:02423 // Returns a list of paths (relative to the extension dir) for images that
424 // the browser might load (like themes and page action icons).
[email protected]9adb9692010-10-29 23:14:02425 std::set<FilePath> GetBrowserImages() const;
[email protected]facd7a7652009-06-05 23:15:02426
[email protected]807871f2010-09-16 01:04:48427 // Get an extension icon as a resource or URL.
[email protected]9adb9692010-10-29 23:14:02428 ExtensionResource GetIconResource(
429 int size, ExtensionIconSet::MatchType match_type) const;
430 GURL GetIconURL(int size, ExtensionIconSet::MatchType match_type) const;
[email protected]f34e79632010-03-17 02:34:08431
[email protected]867a73e12010-03-19 20:45:46432 // Gets the fully resolved absolute launch URL.
433 GURL GetFullLaunchURL() const;
[email protected]2a521c52011-01-26 18:45:21434
[email protected]6f229e82010-11-02 17:47:26435 // Image cache related methods. These are only valid on the UI thread and
436 // not maintained by this class. See ImageLoadingTracker for usage. The
437 // |original_size| parameter should be the size of the image at |source|
438 // before any scaling may have been done to produce the pixels in |image|.
439 void SetCachedImage(const ExtensionResource& source,
440 const SkBitmap& image,
441 const gfx::Size& original_size) const;
442 bool HasCachedImage(const ExtensionResource& source,
443 const gfx::Size& max_size) const;
444 SkBitmap GetCachedImage(const ExtensionResource& source,
445 const gfx::Size& max_size) const;
[email protected]2a521c52011-01-26 18:45:21446
447 // Returns true if this extension can execute script on a page. If a
448 // UserScript object is passed, permission to run that specific script is
449 // checked (using its matches list). Otherwise, permission to execute script
450 // programmatically is checked (using the extension's host permission).
451 //
452 // This method is also aware of certain special pages that extensions are
453 // usually not allowed to run script on.
454 bool CanExecuteScriptOnPage(const GURL& page_url,
[email protected]3aff9ad2011-04-01 20:26:48455 const UserScript* script,
[email protected]2a521c52011-01-26 18:45:21456 std::string* error) const;
457
[email protected]6f229e82010-11-02 17:47:26458 // Returns true if this extension is a COMPONENT extension, or if it is
459 // on the whitelist of extensions that can script all pages.
460 bool CanExecuteScriptEverywhere() const;
461
[email protected]5efbfe012011-02-22 23:07:18462 // Returns true if this extension is allowed to obtain the contents of a
463 // page as an image. Since a page may contain sensitive information, this
464 // is restricted to the extension's host permissions as well as the
465 // extension page itself.
466 bool CanCaptureVisiblePage(const GURL& page_url, std::string* error) const;
467
[email protected]a65882c2010-11-12 15:15:09468 // Returns true if this extension updates itself using the extension
469 // gallery.
470 bool UpdatesFromGallery() const;
471
[email protected]cca147172011-02-17 01:29:29472 // Returns true if this extension or app includes areas within |origin|.
473 bool OverlapsWithOrigin(const GURL& origin) const;
474
[email protected]6f229e82010-11-02 17:47:26475 // Accessors:
476
477 const FilePath& path() const { return path_; }
478 const GURL& url() const { return extension_url_; }
479 Location location() const { return location_; }
480 const std::string& id() const { return id_; }
481 const Version* version() const { return version_.get(); }
482 const std::string VersionString() const;
483 const std::string& name() const { return name_; }
484 const std::string& public_key() const { return public_key_; }
485 const std::string& description() const { return description_; }
486 bool converted_from_user_script() const {
487 return converted_from_user_script_;
488 }
489 const UserScriptList& content_scripts() const { return content_scripts_; }
490 ExtensionAction* page_action() const { return page_action_.get(); }
491 ExtensionAction* browser_action() const { return browser_action_.get(); }
[email protected]e2dffe02011-01-20 20:30:06492 ExtensionSidebarDefaults* sidebar_defaults() const {
493 return sidebar_defaults_.get();
494 }
[email protected]6f229e82010-11-02 17:47:26495 const std::vector<PluginInfo>& plugins() const { return plugins_; }
496 const GURL& background_url() const { return background_url_; }
497 const GURL& options_url() const { return options_url_; }
498 const GURL& devtools_url() const { return devtools_url_; }
499 const std::vector<GURL>& toolstrips() const { return toolstrips_; }
500 const std::set<std::string>& api_permissions() const {
501 return api_permissions_;
502 }
503 const URLPatternList& host_permissions() const { return host_permissions_; }
504 const GURL& update_url() const { return update_url_; }
505 const ExtensionIconSet& icons() const { return icons_; }
506 const DictionaryValue* manifest_value() const {
507 return manifest_value_.get();
508 }
509 const std::string default_locale() const { return default_locale_; }
510 const URLOverrideMap& GetChromeURLOverrides() const {
511 return chrome_url_overrides_;
512 }
513 const std::string omnibox_keyword() const { return omnibox_keyword_; }
514 bool incognito_split_mode() const { return incognito_split_mode_; }
[email protected]a4a38c12010-12-23 16:43:56515 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; }
[email protected]6f229e82010-11-02 17:47:26516
[email protected]3aff9ad2011-04-01 20:26:48517 bool wants_file_access() const { return wants_file_access_; }
518
[email protected]6f229e82010-11-02 17:47:26519 // App-related.
520 bool is_app() const { return is_app_; }
521 bool is_hosted_app() const { return is_app() && !web_extent().is_empty(); }
522 bool is_packaged_app() const { return is_app() && web_extent().is_empty(); }
[email protected]d9696672011-03-15 22:45:09523 bool is_storage_isolated() const { return is_app() && is_storage_isolated_; }
[email protected]6f229e82010-11-02 17:47:26524 const ExtensionExtent& web_extent() const { return extent_; }
525 const std::string& launch_local_path() const { return launch_local_path_; }
526 const std::string& launch_web_url() const { return launch_web_url_; }
527 extension_misc::LaunchContainer launch_container() const {
528 return launch_container_;
529 }
530 int launch_width() const { return launch_width_; }
531 int launch_height() const { return launch_height_; }
532
533 // Theme-related.
534 bool is_theme() const { return is_theme_; }
535 DictionaryValue* GetThemeImages() const { return theme_images_.get(); }
536 DictionaryValue* GetThemeColors() const {return theme_colors_.get(); }
537 DictionaryValue* GetThemeTints() const { return theme_tints_.get(); }
538 DictionaryValue* GetThemeDisplayProperties() const {
539 return theme_display_properties_.get();
540 }
541
[email protected]4a8d3272009-03-10 19:15:08542 private:
[email protected]66e4eb32010-10-27 20:37:41543 friend class base::RefCountedThreadSafe<Extension>;
544
[email protected]d7e9a862010-11-03 21:57:49545 // We keep a cache of images loaded from extension resources based on their
546 // path and a string representation of a size that may have been used to
547 // scale it (or the empty string if the image is at its original size).
548 typedef std::pair<FilePath, std::string> ImageCacheKey;
549 typedef std::map<ImageCacheKey, SkBitmap> ImageCache;
550
[email protected]4ead6f72010-10-13 19:54:18551 // Normalize the path for use by the extension. On Windows, this will make
552 // sure the drive letter is uppercase.
553 static FilePath MaybeNormalizePath(const FilePath& path);
554
[email protected]d6a5c78c2010-12-07 05:18:15555 // Returns the distinct hosts that can be displayed in the install UI or be
556 // used for privilege comparisons. This discards some of the detail that is
557 // present in the manifest to make it as easy as possible to process by users.
558 // In particular we disregard the scheme and path components of URLPatterns
559 // and de-dupe the result, which includes filtering out common hosts with
560 // differing RCDs. If |include_rcd| is true, then the de-duped result
561 // will be the first full entry, including its RCD. So if the list was
562 // "*.google.co.uk" and "*.google.com", the returned value would just be
563 // "*.google.co.uk". Keeping the RCD in the result is useful for display
564 // purposes when you want to show the user one sample hostname from the list.
565 // If you need to compare two URLPatternLists for security equality, then set
566 // |include_rcd| to false, which will return a result like "*.google.",
567 // regardless of the order of the patterns.
568 static std::vector<std::string> GetDistinctHosts(
569 const URLPatternList& host_patterns, bool include_rcd);
570
[email protected]66e4eb32010-10-27 20:37:41571 Extension(const FilePath& path, Location location);
572 ~Extension();
573
574 // Initialize the extension from a parsed manifest.
[email protected]83048a22011-03-29 00:14:13575 bool InitFromValue(const DictionaryValue& value, int flags,
576 std::string* error);
[email protected]66e4eb32010-10-27 20:37:41577
[email protected]052c92702010-06-25 07:25:52578 // Helper function for implementing HasCachedImage/GetCachedImage. A return
579 // value of NULL means there is no matching image cached (we allow caching an
580 // empty SkBitmap).
581 SkBitmap* GetCachedImageImpl(const ExtensionResource& source,
[email protected]9adb9692010-10-29 23:14:02582 const gfx::Size& max_size) const;
[email protected]d9ad80f2010-03-30 20:40:18583
[email protected]3cfbd0e2009-03-18 21:26:24584 // Helper method that loads a UserScript object from a
585 // dictionary in the content_script list of the manifest.
586 bool LoadUserScriptHelper(const DictionaryValue* content_script,
587 int definition_index,
[email protected]3aff9ad2011-04-01 20:26:48588 int flags,
[email protected]3cfbd0e2009-03-18 21:26:24589 std::string* error,
590 UserScript* result);
[email protected]f7f3a5f2009-05-01 22:02:34591
[email protected]6657afa62009-11-04 02:15:20592 // Helper method that loads either the include_globs or exclude_globs list
593 // from an entry in the content_script lists of the manifest.
594 bool LoadGlobsHelper(const DictionaryValue* content_script,
595 int content_script_index,
[email protected]e2194742010-08-12 05:54:34596 const char* globs_property_name,
[email protected]6657afa62009-11-04 02:15:20597 std::string* error,
[email protected]11f4857282009-11-13 19:56:17598 void(UserScript::*add_method)(const std::string& glob),
[email protected]6657afa62009-11-04 02:15:20599 UserScript *instance);
600
[email protected]867a73e12010-03-19 20:45:46601 // Helpers to load various chunks of the manifest.
[email protected]3ba0fd32010-06-19 05:39:10602 bool LoadIsApp(const DictionaryValue* manifest, std::string* error);
[email protected]542258c2011-03-04 21:25:31603 bool LoadExtent(const DictionaryValue* manifest,
604 const char* key,
605 ExtensionExtent* extent,
606 const char* list_error,
607 const char* value_error,
608 URLPattern::ParseOption parse_strictness,
609 std::string* error);
[email protected]867a73e12010-03-19 20:45:46610 bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error);
611 bool LoadLaunchURL(const DictionaryValue* manifest, std::string* error);
[email protected]d9696672011-03-15 22:45:09612 bool LoadAppIsolation(const DictionaryValue* manifest, std::string* error);
[email protected]cbf4d1912010-08-12 18:24:57613 bool EnsureNotHybridApp(const DictionaryValue* manifest, std::string* error);
[email protected]867a73e12010-03-19 20:45:46614
[email protected]5d246db22009-10-27 06:17:57615 // Helper method to load an ExtensionAction from the page_action or
[email protected]92c6f9b92009-10-24 04:35:08616 // browser_action entries in the manifest.
[email protected]5d246db22009-10-27 06:17:57617 ExtensionAction* LoadExtensionActionHelper(
[email protected]92c6f9b92009-10-24 04:35:08618 const DictionaryValue* extension_action, std::string* error);
619
[email protected]e2dffe02011-01-20 20:30:06620 // Helper method to load an ExtensionSidebarDefaults from the sidebar manifest
621 // entry.
622 ExtensionSidebarDefaults* LoadExtensionSidebarDefaults(
623 const DictionaryValue* sidebar, std::string* error);
624
[email protected]4361c7c2010-09-30 21:57:53625 // Calculates the effective host permissions from the permissions and content
626 // script petterns.
627 void InitEffectiveHostPermissions();
628
[email protected]2f6698b2010-10-14 00:58:21629 // Returns true if the extension has more than one "UI surface". For example,
630 // an extension that has a browser action and a page action.
631 bool HasMultipleUISurfaces() const;
632
[email protected]e2eb43112009-05-29 21:19:54633 // Figures out if a source contains keys not associated with themes - we
634 // don't want to allow scripts and such to be bundled with themes.
[email protected]9adb9692010-10-29 23:14:02635 bool ContainsNonThemeKeys(const DictionaryValue& source) const;
[email protected]e2eb43112009-05-29 21:19:54636
[email protected]1952c7d2010-03-04 23:48:34637 // Returns true if the string is one of the known api permissions (see
[email protected]0df165f2010-09-28 16:49:40638 // kPermissions).
[email protected]9adb9692010-10-29 23:14:02639 bool IsAPIPermission(const std::string& permission) const;
[email protected]1952c7d2010-03-04 23:48:34640
[email protected]a2a098d2010-09-29 19:42:55641 // The set of unique API install messages that the extension has.
642 // NOTE: This only includes messages related to permissions declared in the
643 // "permissions" key in the manifest. Permissions implied from other features
644 // of the manifest, like plugins and content scripts are not included.
[email protected]9adb9692010-10-29 23:14:02645 std::set<string16> GetSimplePermissionMessages() const;
[email protected]a2a098d2010-09-29 19:42:55646
647 // The permission message displayed related to the host permissions for
648 // this extension.
[email protected]9adb9692010-10-29 23:14:02649 string16 GetHostPermissionMessage() const;
[email protected]a2a098d2010-09-29 19:42:55650
[email protected]d7e9a862010-11-03 21:57:49651 // Cached images for this extension. This should only be touched on the UI
652 // thread.
653 mutable ImageCache image_cache_;
[email protected]1e8c93f2010-02-08 22:58:31654
[email protected]6f229e82010-11-02 17:47:26655 // A persistent, globally unique ID. An extension's ID is used in things
656 // like directory structures and URLs, and is expected to not change across
657 // versions. It is generated as a SHA-256 hash of the extension's public
658 // key, or as a hash of the path in the case of unpacked extensions.
659 std::string id_;
660
661 // The extension's human-readable name. Name is used for display purpose. It
662 // might be wrapped with unicode bidi control characters so that it is
663 // displayed correctly in RTL context.
664 // NOTE: Name is UTF-8 and may contain non-ascii characters.
665 std::string name_;
666
667 // The absolute path to the directory the extension is stored in.
668 FilePath path_;
669
670 // Default locale for fall back. Can be empty if extension is not localized.
671 std::string default_locale_;
672
673 // If true, a separate process will be used for the extension in incognito
674 // mode.
675 bool incognito_split_mode_;
676
677 // Defines the set of URLs in the extension's web content.
678 ExtensionExtent extent_;
679
680 // The set of host permissions that the extension effectively has access to,
681 // which is a merge of host_permissions_ and all of the match patterns in
682 // any content scripts the extension has. This is used to determine which
683 // URLs have the ability to load an extension's resources via embedded
684 // chrome-extension: URLs (see extension_protocols.cc).
685 ExtensionExtent effective_host_permissions_;
686
687 // The set of module-level APIs this extension can use.
688 std::set<std::string> api_permissions_;
689
690 // The icons for the extension.
691 ExtensionIconSet icons_;
692
693 // The base extension url for the extension.
694 GURL extension_url_;
695
696 // The location the extension was loaded from.
697 Location location_;
698
699 // The extension's version.
700 scoped_ptr<Version> version_;
701
702 // An optional longer description of the extension.
703 std::string description_;
704
705 // True if the extension was generated from a user script. (We show slightly
706 // different UI if so).
707 bool converted_from_user_script_;
708
709 // Paths to the content scripts the extension contains.
710 UserScriptList content_scripts_;
711
712 // The extension's page action, if any.
713 scoped_ptr<ExtensionAction> page_action_;
714
715 // The extension's browser action, if any.
716 scoped_ptr<ExtensionAction> browser_action_;
717
[email protected]e2dffe02011-01-20 20:30:06718 // The extension's sidebar, if any.
719 scoped_ptr<ExtensionSidebarDefaults> sidebar_defaults_;
720
[email protected]6f229e82010-11-02 17:47:26721 // Optional list of NPAPI plugins and associated properties.
722 std::vector<PluginInfo> plugins_;
723
724 // Optional URL to a master page of which a single instance should be always
725 // loaded in the background.
726 GURL background_url_;
727
728 // Optional URL to a page for setting options/preferences.
729 GURL options_url_;
730
731 // Optional URL to a devtools extension page.
732 GURL devtools_url_;
733
734 // Optional list of toolstrips and associated properties.
735 std::vector<GURL> toolstrips_;
736
737 // The public key used to sign the contents of the crx package.
738 std::string public_key_;
739
740 // A map of resource id's to relative file paths.
741 scoped_ptr<DictionaryValue> theme_images_;
742
743 // A map of color names to colors.
744 scoped_ptr<DictionaryValue> theme_colors_;
745
746 // A map of color names to colors.
747 scoped_ptr<DictionaryValue> theme_tints_;
748
749 // A map of display properties.
750 scoped_ptr<DictionaryValue> theme_display_properties_;
751
752 // Whether the extension is a theme.
753 bool is_theme_;
754
755 // The sites this extension has permission to talk to (using XHR, etc).
756 URLPatternList host_permissions_;
757
758 // The homepage for this extension. Useful if it is not hosted by Google and
759 // therefore does not have a Gallery URL.
760 GURL homepage_url_;
761
762 // URL for fetching an update manifest
763 GURL update_url_;
764
765 // A copy of the manifest that this extension was created from.
766 scoped_ptr<DictionaryValue> manifest_value_;
767
768 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs
769 // which override the handling of those URLs. (see ExtensionOverrideUI).
770 URLOverrideMap chrome_url_overrides_;
771
772 // Whether this extension uses app features.
773 bool is_app_;
774
[email protected]d9696672011-03-15 22:45:09775 // Whether this extension requests isolated storage.
776 bool is_storage_isolated_;
777
[email protected]6f229e82010-11-02 17:47:26778 // The local path inside the extension to use with the launcher.
779 std::string launch_local_path_;
780
781 // A web url to use with the launcher. Note that this might be relative or
782 // absolute. If relative, it is relative to web_origin.
783 std::string launch_web_url_;
784
[email protected]4e595682011-02-09 17:07:02785 // The window type that an app's manifest specifies to launch into.
786 // This is not always the window type an app will open into, because
787 // users can override the way each app launches. See
788 // ExtensionPrefs::GetLaunchContainer(), which looks at a per-app pref
789 // to decide what container an app will launch in.
[email protected]6f229e82010-11-02 17:47:26790 extension_misc::LaunchContainer launch_container_;
791
792 // The default size of the container when launching. Only respected for
793 // containers like panels and windows.
794 int launch_width_;
795 int launch_height_;
796
797 // The Omnibox keyword for this extension, or empty if there is none.
798 std::string omnibox_keyword_;
799
[email protected]a4a38c12010-12-23 16:43:56800 // List of text-to-speech voices that this extension provides, if any.
801 std::vector<TtsVoice> tts_voices_;
802
[email protected]3aff9ad2011-04-01 20:26:48803 // Whether the extension has host permissions or user script patterns that
804 // imply access to file:/// scheme URLs (the user may not have actually
805 // granted it that access).
806 bool wants_file_access_;
807
[email protected]eaa7dd182010-12-14 11:09:00808 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
[email protected]5eb375e92010-11-26 07:50:41809 UpdateExtensionPreservesLocation);
[email protected]19118d52010-07-26 22:13:42810 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper);
[email protected]66e4eb32010-10-27 20:37:41811 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, InitFromValueInvalid);
812 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, InitFromValueValid);
813 FRIEND_TEST_ALL_PREFIXES(ExtensionTest, InitFromValueValidNameInRTL);
[email protected]19118d52010-07-26 22:13:42814 FRIEND_TEST_ALL_PREFIXES(TabStripModelTest, Apps);
[email protected]ae7fe712009-07-02 20:33:58815
[email protected]894bb502009-05-21 22:39:57816 DISALLOW_COPY_AND_ASSIGN(Extension);
[email protected]7713d632008-12-02 07:52:33817};
818
[email protected]9adb9692010-10-29 23:14:02819typedef std::vector< scoped_refptr<const Extension> > ExtensionList;
[email protected]ec5b50d2010-10-09 16:35:18820typedef std::set<std::string> ExtensionIdSet;
[email protected]b1748b1d82009-11-30 20:32:56821
[email protected]c6d474f82009-12-16 21:11:06822// Handy struct to pass core extension info around.
823struct ExtensionInfo {
824 ExtensionInfo(const DictionaryValue* manifest,
825 const std::string& id,
826 const FilePath& path,
[email protected]3bb84992010-08-26 17:23:46827 Extension::Location location);
828 ~ExtensionInfo();
[email protected]c6d474f82009-12-16 21:11:06829
830 scoped_ptr<DictionaryValue> extension_manifest;
831 std::string extension_id;
832 FilePath extension_path;
833 Extension::Location extension_location;
834
835 private:
836 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo);
837};
838
[email protected]211030342010-09-30 18:41:06839// Struct used for the details of the EXTENSION_UNINSTALLED
840// notification.
841struct UninstalledExtensionInfo {
842 explicit UninstalledExtensionInfo(const Extension& extension);
[email protected]9b2331d92010-10-04 23:11:19843 ~UninstalledExtensionInfo();
[email protected]211030342010-09-30 18:41:06844
845 std::string extension_id;
846 std::set<std::string> extension_api_permissions;
[email protected]7fa19f82010-12-21 19:40:08847 Extension::Type extension_type;
[email protected]76c25112010-10-01 22:37:21848 GURL update_url;
[email protected]211030342010-09-30 18:41:06849};
850
[email protected]a9f39a312010-12-23 22:14:27851struct UnloadedExtensionInfo {
852 enum Reason {
853 DISABLE, // The extension is being disabled.
854 UPDATE, // The extension is being updated to a newer version.
855 UNINSTALL, // The extension is being uninstalled.
856 };
857
858 Reason reason;
859
860 // Was the extension already disabled?
861 bool already_disabled;
862
863 // The extension being unloaded - this should always be non-NULL.
864 const Extension* extension;
865
866 UnloadedExtensionInfo(const Extension* extension, Reason reason);
867};
868
[email protected]5b1a0e22009-05-26 19:00:58869#endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_