OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 case sync_api::SyncManager::Status::CONFLICT: | 765 case sync_api::SyncManager::Status::CONFLICT: |
766 return "CONFLICT"; | 766 return "CONFLICT"; |
767 case sync_api::SyncManager::Status::OFFLINE_UNUSABLE: | 767 case sync_api::SyncManager::Status::OFFLINE_UNUSABLE: |
768 return "OFFLINE_UNUSABLE"; | 768 return "OFFLINE_UNUSABLE"; |
769 case sync_api::SyncManager::Status::INVALID: // fall through | 769 case sync_api::SyncManager::Status::INVALID: // fall through |
770 default: | 770 default: |
771 return "UNKNOWN"; | 771 return "UNKNOWN"; |
772 } | 772 } |
773 } | 773 } |
774 | 774 |
| 775 bool ProfileSyncService::unrecoverable_error_detected() const { |
| 776 return unrecoverable_error_detected_; |
| 777 } |
| 778 |
775 string16 ProfileSyncService::GetLastSyncedTimeString() const { | 779 string16 ProfileSyncService::GetLastSyncedTimeString() const { |
776 if (last_synced_time_.is_null()) | 780 if (last_synced_time_.is_null()) |
777 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); | 781 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); |
778 | 782 |
779 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; | 783 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; |
780 | 784 |
781 if (last_synced < base::TimeDelta::FromMinutes(1)) | 785 if (last_synced < base::TimeDelta::FromMinutes(1)) |
782 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); | 786 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); |
783 | 787 |
784 return TimeFormat::TimeElapsed(last_synced); | 788 return TimeFormat::TimeElapsed(last_synced); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 // is initialized, all enabled data types are consistent with one | 1153 // is initialized, all enabled data types are consistent with one |
1150 // another, and no unrecoverable error has transpired. | 1154 // another, and no unrecoverable error has transpired. |
1151 if (unrecoverable_error_detected_) | 1155 if (unrecoverable_error_detected_) |
1152 return false; | 1156 return false; |
1153 | 1157 |
1154 if (!data_type_manager_.get()) | 1158 if (!data_type_manager_.get()) |
1155 return false; | 1159 return false; |
1156 | 1160 |
1157 return data_type_manager_->state() == DataTypeManager::CONFIGURED; | 1161 return data_type_manager_->state() == DataTypeManager::CONFIGURED; |
1158 } | 1162 } |
OLD | NEW |