| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 else | 683 else |
| 684 ShutdownImpl(syncer::STOP_SYNC); | 684 ShutdownImpl(syncer::STOP_SYNC); |
| 685 } | 685 } |
| 686 | 686 |
| 687 backend_mode_ = mode; | 687 backend_mode_ = mode; |
| 688 | 688 |
| 689 if (backend_mode_ == BACKUP) | 689 if (backend_mode_ == BACKUP) |
| 690 backup_start_time_ = base::Time::Now(); | 690 backup_start_time_ = base::Time::Now(); |
| 691 | 691 |
| 692 if (backend_mode_ == SYNC && !backup_start_time_.is_null()) { | 692 if (backend_mode_ == SYNC && !backup_start_time_.is_null()) { |
| 693 UMA_HISTOGRAM_TIMES("first-sync-delay-by-backup", | 693 UMA_HISTOGRAM_MEDIUM_TIMES("Sync.FirstSyncDelayByBackup", |
| 694 base::Time::Now() - backup_start_time_); | 694 base::Time::Now() - backup_start_time_); |
| 695 backup_start_time_ = base::Time(); | 695 backup_start_time_ = base::Time(); |
| 696 } | 696 } |
| 697 | 697 |
| 698 if (backend_mode_ == ROLLBACK) | 698 if (backend_mode_ == ROLLBACK) |
| 699 ClearBrowsingDataSinceFirstSync(); | 699 ClearBrowsingDataSinceFirstSync(); |
| 700 else if (backend_mode_ == SYNC) | 700 else if (backend_mode_ == SYNC) |
| 701 CheckSyncBackupIfNeeded(); | 701 CheckSyncBackupIfNeeded(); |
| 702 | 702 |
| 703 base::FilePath sync_folder = backend_mode_ == SYNC ? | 703 base::FilePath sync_folder = backend_mode_ == SYNC ? |
| 704 base::FilePath(kSyncDataFolderName) : | 704 base::FilePath(kSyncDataFolderName) : |
| (...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2762 true)); | 2762 true)); |
| 2763 } | 2763 } |
| 2764 | 2764 |
| 2765 bool ProfileSyncService::NeedBackup() const { | 2765 bool ProfileSyncService::NeedBackup() const { |
| 2766 return need_backup_; | 2766 return need_backup_; |
| 2767 } | 2767 } |
| 2768 | 2768 |
| 2769 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { | 2769 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { |
| 2770 return backend_->GetSyncedDeviceTracker()->GetLocalDeviceBackupTime(); | 2770 return backend_->GetSyncedDeviceTracker()->GetLocalDeviceBackupTime(); |
| 2771 } | 2771 } |
| OLD | NEW |