Chromium Code Reviews| Index: chrome/browser/sync/profile_sync_service.cc |
| diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc |
| index 03001b436101ecf8c819835ded23f3aa16d15b2d..b745c131b51b6047072fbde65ccb9613f70aa5c2 100644 |
| --- a/chrome/browser/sync/profile_sync_service.cc |
| +++ b/chrome/browser/sync/profile_sync_service.cc |
| @@ -32,6 +32,7 @@ |
| #include "chrome/browser/defaults.h" |
| #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
| #include "chrome/browser/net/chrome_cookie_notification_details.h" |
| +#include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| #include "chrome/browser/prefs/pref_service_syncable.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| @@ -521,11 +522,18 @@ bool ProfileSyncService::ShouldDeleteSyncFolder() { |
| if (backend_mode_ == SYNC) |
| return !HasSyncSetupCompleted(); |
| - // Start fresh if it's the first time backup after user stopped syncing. |
| - // This is needed because backup DB may contain items deleted by user during |
| - // sync period and can cause back-from-dead issues. |
| - if (backend_mode_ == BACKUP && !sync_prefs_.GetFirstSyncTime().is_null()) |
| - return true; |
| + if (backend_mode_ == BACKUP) { |
| + // Start fresh if: |
| + // * It's the first time backup after user stopped syncing because backup |
| + // DB may contain items deleted by user during sync period and can cause |
| + // back-from-dead issues if user didn't choose rollback. |
| + // * Settings are reset because of tampering to avoid restoring settings |
| + // from backup. |
| + if (!sync_prefs_.GetFirstSyncTime().is_null() || |
| + profile_->GetStartTime() <= chrome_prefs::GetResetTime(profile_)) { |
|
gab
2014/07/07 20:56:12
Technically this will work if chrome_prefs::GetRes
|
| + return true; |
| + } |
| + } |
| return false; |
| } |