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

Unified Diff: chrome/common/extensions/extension.cc

Issue 9340007: Make the Chrome Web Store Icon Syncable (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removing braces Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 04475081a52ddc8d892092fde25f1caeb48a4a19..b48968f8d8ae646a721edf116c961020704722ca 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -2971,8 +2971,7 @@ bool Extension::OverlapsWithOrigin(const GURL& origin) const {
}
Extension::SyncType Extension::GetSyncType() const {
- // TODO(akalin): Figure out if we need to allow some other types.
- if (location() != Extension::INTERNAL) {
+ if (!IsSyncable()) {
// We have a non-standard location.
return SYNC_TYPE_NONE;
}
@@ -3012,6 +3011,25 @@ Extension::SyncType Extension::GetSyncType() const {
}
}
+bool Extension::IsSyncable() const {
+ // TODO(akalin): Figure out if we need to allow some other types.
+
+ // We want to sync any extensions that are shown in the luancher because
+ // their positions should sync.
+ return location_ == Extension::INTERNAL ||
+ ShouldDisplayInLauncher();
+
+}
+
+bool Extension::ShouldDisplayInLauncher() const {
+ // The CWS needs to be treated as syncable app because it appears on the NTP
+ // and we need to make sure its position values are synced.
+ // If another case arises where we need to have a special case like the CWS,
+ // something more systematic should be done.
+ return location_ == Extension::INTERNAL ||
+ id() == extension_misc::kWebStoreAppId;
+}
+
ExtensionInfo::ExtensionInfo(const DictionaryValue* manifest,
const std::string& id,
const FilePath& path,
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698