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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 147443007: Add support for localized time strings with two units, eg. "2 hours 17 minutes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup and documentation Created 6 years, 10 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 unified diff | Download patch
OLDNEW
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 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 1584
1585 base::string16 ProfileSyncService::GetLastSyncedTimeString() const { 1585 base::string16 ProfileSyncService::GetLastSyncedTimeString() const {
1586 if (last_synced_time_.is_null()) 1586 if (last_synced_time_.is_null())
1587 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER); 1587 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER);
1588 1588
1589 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; 1589 base::TimeDelta last_synced = base::Time::Now() - last_synced_time_;
1590 1590
1591 if (last_synced < base::TimeDelta::FromMinutes(1)) 1591 if (last_synced < base::TimeDelta::FromMinutes(1))
1592 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW); 1592 return l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW);
1593 1593
1594 return ui::TimeFormat::TimeElapsed(last_synced); 1594 return ui::TimeFormat::Simple(ui::TimeFormat::kElapsed,
1595 ui::TimeFormat::kShort, last_synced);
1595 } 1596 }
1596 1597
1597 void ProfileSyncService::UpdateSelectedTypesHistogram( 1598 void ProfileSyncService::UpdateSelectedTypesHistogram(
1598 bool sync_everything, const syncer::ModelTypeSet chosen_types) const { 1599 bool sync_everything, const syncer::ModelTypeSet chosen_types) const {
1599 if (!HasSyncSetupCompleted() || 1600 if (!HasSyncSetupCompleted() ||
1600 sync_everything != sync_prefs_.HasKeepEverythingSynced()) { 1601 sync_everything != sync_prefs_.HasKeepEverythingSynced()) {
1601 UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything); 1602 UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything);
1602 } 1603 }
1603 1604
1604 // Only log the data types that are shown in the sync settings ui. 1605 // 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
2246 status.last_get_token_error = last_get_token_error_; 2247 status.last_get_token_error = last_get_token_error_;
2247 if (request_access_token_retry_timer_.IsRunning()) 2248 if (request_access_token_retry_timer_.IsRunning())
2248 status.next_token_request_time = next_token_request_time_; 2249 status.next_token_request_time = next_token_request_time_;
2249 return status; 2250 return status;
2250 } 2251 }
2251 2252
2252 void ProfileSyncService::OverrideNetworkResourcesForTest( 2253 void ProfileSyncService::OverrideNetworkResourcesForTest(
2253 scoped_ptr<syncer::NetworkResources> network_resources) { 2254 scoped_ptr<syncer::NetworkResources> network_resources) {
2254 network_resources_ = network_resources.Pass(); 2255 network_resources_ = network_resources.Pass();
2255 } 2256 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698