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

Unified Diff: chrome/browser/sync/glue/extension_util.cc

Issue 2884025: Disallow syncing of extensions with third-party update URLs or plugins. (Closed)
Patch Set: Tightened check Created 10 years, 5 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
Index: chrome/browser/sync/glue/extension_util.cc
diff --git a/chrome/browser/sync/glue/extension_util.cc b/chrome/browser/sync/glue/extension_util.cc
index d34eafe4a23fa72c71633726051d43592e9ef604..1fad37e1d3be6fccf8517a39976dd1518bd0f9d8 100644
--- a/chrome/browser/sync/glue/extension_util.cc
+++ b/chrome/browser/sync/glue/extension_util.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "googleurl/src/gurl.h"
namespace browser_sync {
@@ -33,6 +34,26 @@ bool IsExtensionSyncable(const Extension& extension) {
return false;
}
+ // 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 (!extension.update_url().is_empty() &&
+ (extension.update_url() !=
+ GURL(extension_urls::kGalleryUpdateHttpUrl)) &&
+ (extension.update_url() !=
+ GURL(extension_urls::kGalleryUpdateHttpsUrl))) {
+ return false;
+ }
+
+ // Disallow extensions with native code plugins.
+ //
+ // TODO(akalin): Relax this restriction once we've put in UI to
+ // approve synced extensions.
+ if (!extension.plugins().empty()) {
+ return false;
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698