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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 3110008: Massive refactoring of extensions sync code (Closed) Base URL: 76.121.192.83:~/projects/chromium/src
Patch Set: Fixed compile error Created 10 years, 4 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 | « no previous file | chrome/browser/sync/glue/extension_change_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index fde71aa6eaa4c5517b9ad2ff0f34c4ab14aef3ab..c9df30fa0d0cb3a13c6154b933898ff31cfe27fe 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -37,6 +37,7 @@
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/sync/glue/extension_sync_traits.h"
#include "chrome/browser/sync/glue/extension_util.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_switches.h"
@@ -962,8 +963,15 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension,
NewRunnableFunction(&DeleteFileHelper, extension->path(), true));
return;
}
+ // TODO(akalin): When we do apps sync, we have to work with its
+ // traits, too.
+ const browser_sync::ExtensionSyncTraits extension_sync_traits =
+ browser_sync::GetExtensionSyncTraits();
+ // If an extension is a theme, we bypass the valid/syncable check
+ // as themes are harmless.
if (!extension->is_theme() &&
- !browser_sync::IsExtensionSyncable(*extension)) {
+ !browser_sync::IsExtensionValidAndSyncable(
+ *extension, extension_sync_traits.allowed_extension_types)) {
// We're an extension installed via sync that is unsyncable,
// i.e. we may have been syncable previously. We block these
// installs. We'll have to update the clause above if we decide
@@ -978,7 +986,8 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension,
// TODO(akalin): Remove this check once we've put in UI to
// approve synced extensions.
LOG(WARNING)
- << "Not installing non-syncable extension " << extension->id();
+ << "Not installing invalid or unsyncable extension "
+ << extension->id();
// Delete the extension directory since we're not going to
// load it.
ChromeThread::PostTask(
« no previous file with comments | « no previous file | chrome/browser/sync/glue/extension_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698