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 <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 | 1579 |
1580 base::string16 ProfileSyncService::GetLastSyncedTimeString() const { | 1580 base::string16 ProfileSyncService::GetLastSyncedTimeString() const { |
1581 if (last_synced_time_.is_null()) | 1581 if (last_synced_time_.is_null()) |
1582 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); | 1582 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); |
1583 | 1583 |
1584 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; | 1584 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; |
1585 | 1585 |
1586 if (last_synced < base::TimeDelta::FromMinutes(1)) | 1586 if (last_synced < base::TimeDelta::FromMinutes(1)) |
1587 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); | 1587 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); |
1588 | 1588 |
1589 return ui::TimeFormat::TimeElapsed(last_synced); | 1589 return ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_ELAPSED, |
| 1590 ui::TimeFormat::LENGTH_SHORT, last_synced); |
1590 } | 1591 } |
1591 | 1592 |
1592 void ProfileSyncService::UpdateSelectedTypesHistogram( | 1593 void ProfileSyncService::UpdateSelectedTypesHistogram( |
1593 bool sync_everything, const syncer::ModelTypeSet chosen_types) const { | 1594 bool sync_everything, const syncer::ModelTypeSet chosen_types) const { |
1594 if (!HasSyncSetupCompleted() || | 1595 if (!HasSyncSetupCompleted() || |
1595 sync_everything != sync_prefs_.HasKeepEverythingSynced()) { | 1596 sync_everything != sync_prefs_.HasKeepEverythingSynced()) { |
1596 UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything); | 1597 UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything); |
1597 } | 1598 } |
1598 | 1599 |
1599 // Only log the data types that are shown in the sync settings ui. | 1600 // Only log the data types that are shown in the sync settings ui. |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2241 status.last_get_token_error = last_get_token_error_; | 2242 status.last_get_token_error = last_get_token_error_; |
2242 if (request_access_token_retry_timer_.IsRunning()) | 2243 if (request_access_token_retry_timer_.IsRunning()) |
2243 status.next_token_request_time = next_token_request_time_; | 2244 status.next_token_request_time = next_token_request_time_; |
2244 return status; | 2245 return status; |
2245 } | 2246 } |
2246 | 2247 |
2247 void ProfileSyncService::OverrideNetworkResourcesForTest( | 2248 void ProfileSyncService::OverrideNetworkResourcesForTest( |
2248 scoped_ptr<syncer::NetworkResources> network_resources) { | 2249 scoped_ptr<syncer::NetworkResources> network_resources) { |
2249 network_resources_ = network_resources.Pass(); | 2250 network_resources_ = network_resources.Pass(); |
2250 } | 2251 } |
OLD | NEW |