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

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

Issue 2353213002: arc: Fix Android App resurrected by sync. (Closed)
Patch Set: Remove redundant pref observer. 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
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20f75b77cf47bb20501a950fe513ee5b0710d4a7..99cff6f498eb201b759be06212d163ce263908af 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
@@ -9,7 +9,6 @@
#include <vector>
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h"
#include "chrome/common/pref_names.h"
@@ -17,9 +16,6 @@
#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/pref_names.h"
-#include "components/sync/driver/sync_prefs.h"
-#include "components/sync/driver/sync_service.h"
#include "components/sync/protocol/sync.pb.h"
namespace arc {
@@ -78,26 +74,6 @@ std::unique_ptr<ArcSyncItem> CreateSyncItemFromPrefs(
package_info->last_backup_android_id, package_info->last_backup_time);
}
-bool ValidateEnableArcPackageSyncPref(Profile* profile) {
- PrefService* pref_service = profile->GetPrefs();
- // If device is set to sync everything, Arc package should be synced.
- if (pref_service->GetBoolean(sync_driver::prefs::kSyncKeepEverythingSynced))
- return true;
-
- bool apps_sync_enable = pref_service->GetBoolean(
- sync_driver::SyncPrefs::GetPrefNameForDataType(syncer::APPS));
- // ArcPackage sync service is controlled by apps checkbox in sync settings.
- // Update ArcPackage sync setting pref if it is different from apps sync
- // setting pref.
- const char* arc_sync_path =
- sync_driver::SyncPrefs::GetPrefNameForDataType(syncer::ARC_PACKAGE);
- if (apps_sync_enable != pref_service->GetBoolean(arc_sync_path)) {
- pref_service->SetBoolean(arc_sync_path, apps_sync_enable);
- }
-
- return apps_sync_enable;
-}
-
} // namespace
// ArcPackageSyncableService::SyncItem
@@ -254,17 +230,6 @@ bool ArcPackageSyncableService::SyncStarted() {
if (sync_processor_.get())
return true;
- sync_driver::SyncService* sync_service =
- ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_);
- // ArcPackage sync service is controlled by apps checkbox in sync settings.
- bool arc_package_sync_should_enable =
- ValidateEnableArcPackageSyncPref(profile_);
-
- 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.";
flare_ = sync_start_util::GetFlareForSyncableService(profile_->GetPath());
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698