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

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

Issue 2054773002: Replace the WAS_INSTALLED_BY_CUSTODIAN creation flag with a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the bug of delegated installs for pre-existing extensions Created 4 years, 6 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/extensions/extension_sync_service.cc
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc
index 86824c6673779da2f85b79f15c1ccf6b72c6b467..097e6d274bc1e7ca226d06f7dc0788e379230bbe 100644
--- a/chrome/browser/extensions/extension_sync_service.cc
+++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -34,6 +34,7 @@
#include "sync/api/sync_error_factory.h"
#if defined(ENABLE_SUPERVISED_USERS)
+#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/supervised_user/supervised_user_service.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#endif
@@ -199,6 +200,7 @@ syncer::SyncMergeResult ExtensionSyncService::MergeDataAndStartSyncing(
for (const syncer::SyncData& sync_data : initial_sync_data) {
std::unique_ptr<ExtensionSyncData> extension_sync_data(
ExtensionSyncData::CreateFromSyncData(sync_data));
+
Marc Treib 2016/06/13 09:37:14 Please avoid unnecessary changes like this.
mamir 2016/06/13 11:30:16 Sorry. Overlooked it after removing a LOG statemen
// If the extension has local state that needs to be synced, ignore this
// change (we assume the local state is more recent).
if (extension_sync_data &&
@@ -315,6 +317,13 @@ void ExtensionSyncService::ApplySyncData(
// sync data, so that we don't end up notifying ourselves.
base::AutoReset<bool> ignore_updates(&ignore_updates_, true);
+#if defined(ENABLE_SUPERVISED_USERS)
Marc Treib 2016/06/13 09:37:14 I don't think this needs an #ifdef. All the other
mamir 2016/06/13 11:30:16 Done.
+ if (extension_sync_data.installed_by_custodian()) {
+ extensions::util::SetIsInstalledByCustodian(extension_sync_data.id(),
+ profile_, true);
+ }
+#endif
+
syncer::ModelType type = extension_sync_data.is_app() ? syncer::APPS
: syncer::EXTENSIONS;
const std::string& id = extension_sync_data.id();

Powered by Google App Engine
This is Rietveld 408576698