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

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

Issue 2311463002: [Merge to M53]arc: Enable user control for Arc package sync. (Closed)
Patch Set: arc: Enable user control for Arc package sync. Created 4 years, 3 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 072d8ad12dd536ba0d957154323e2f1a7e24195d..61fbba637b4cb2a59b1e6ad6f6cb7462a47e0c41 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
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/scoped_user_pref_update.h"
+#include "components/sync_driver/sync_prefs.h"
#include "components/sync_driver/sync_service.h"
#include "sync/api/sync_change_processor.h"
#include "sync/api/sync_data.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