| Index: chrome/common/extensions/extension.cc
|
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
|
| index 1b623538d0ce3e7064f8213bb0938268844e8943..f0924841a2cf8088b233f4f122e335e7e9a1b5c3 100644
|
| --- a/chrome/common/extensions/extension.cc
|
| +++ b/chrome/common/extensions/extension.cc
|
| @@ -282,7 +282,7 @@ Extension::Location Extension::GetHigherPriorityLocation(
|
| // deterministicly choose a location.
|
| CHECK(loc1_rank != loc2_rank);
|
|
|
| - // Lowest rank has highest priority.
|
| + // Highest rank has highest priority.
|
| return (loc1_rank > loc2_rank ? loc1 : loc2 );
|
| }
|
|
|
| @@ -2824,6 +2824,52 @@ bool Extension::OverlapsWithOrigin(const GURL& origin) const {
|
| return web_extent().OverlapsWith(origin_only_pattern_list);
|
| }
|
|
|
| +Extension::SyncType Extension::GetSyncType() const {
|
| + // TODO(akalin): Figure out if we need to allow some other types.
|
| + if (location() != Extension::INTERNAL) {
|
| + // We have a non-standard location.
|
| + return SYNC_TYPE_NONE;
|
| + }
|
| +
|
| + // Disallow extensions with non-gallery auto-update URLs for now.
|
| + //
|
| + // TODO(akalin): Relax this restriction once we've put in UI to
|
| + // approve synced extensions.
|
| + if (!update_url().is_empty() &&
|
| + (update_url() != GalleryUpdateUrl(false)) &&
|
| + (update_url() != GalleryUpdateUrl(true))) {
|
| + return SYNC_TYPE_NONE;
|
| + }
|
| +
|
| + // Disallow extensions with native code plugins.
|
| + //
|
| + // TODO(akalin): Relax this restriction once we've put in UI to
|
| + // approve synced extensions.
|
| + if (!plugins().empty()) {
|
| + return SYNC_TYPE_NONE;
|
| + }
|
| +
|
| + switch (GetType()) {
|
| + case Extension::TYPE_EXTENSION:
|
| + return SYNC_TYPE_EXTENSION;
|
| +
|
| + case Extension::TYPE_USER_SCRIPT:
|
| + // We only want to sync user scripts with gallery update URLs.
|
| + if (update_url() == GalleryUpdateUrl(true) ||
|
| + update_url() == GalleryUpdateUrl(false))
|
| + return SYNC_TYPE_EXTENSION;
|
| + else
|
| + return SYNC_TYPE_NONE;
|
| +
|
| + case Extension::TYPE_HOSTED_APP:
|
| + case Extension::TYPE_PACKAGED_APP:
|
| + return SYNC_TYPE_APP;
|
| +
|
| + default:
|
| + return SYNC_TYPE_NONE;
|
| + }
|
| +}
|
| +
|
| ExtensionInfo::ExtensionInfo(const DictionaryValue* manifest,
|
| const std::string& id,
|
| const FilePath& path,
|
|
|