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

Unified Diff: chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc

Issue 2277593002: arc: Enable user control for Arc package sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix componets unit_tests Created 4 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
Index: chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
index 9b4dcf76682505dccee5006e26e9033e91b9ec55..0efa35fa35e1cff7ba746552468dee7e80390cae 100644
--- a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
+++ b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
@@ -15,6 +15,7 @@
#include "components/sync/api/sync_change_processor.h"
#include "components/sync/api/sync_data.h"
#include "components/sync/api/sync_merge_result.h"
+#include "components/sync/driver/sync_prefs.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/protocol/sync.pb.h"
@@ -229,8 +230,14 @@ bool ArcPackageSyncableService::SyncStarted() {
sync_driver::SyncService* sync_service =
ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_);
- if (sync_service)
- sync_service->ReenableDatatype(syncer::ARC_PACKAGE);
+ // ArcPackage sync service is controlled by apps checkbox in sync settings.
+ bool arc_package_sync_should_enable = profile_->GetPrefs()->GetBoolean(
+ sync_driver::SyncPrefs::GetPrefNameForDataType(syncer::ARC_PACKAGE));
+
+ if (!sync_service || !arc_package_sync_should_enable)
+ return false;
+
+ sync_service->ReenableDatatype(syncer::ARC_PACKAGE);
if (flare_.is_null()) {
VLOG(2) << this << ": SyncStarted: Flare.";
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc ('k') | components/sync/driver/sync_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698