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

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

Issue 6064003: Update the time formatting APIs to use string16.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
OLDNEW
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/sync_ui_util.h" 5 #include "chrome/browser/sync/sync_ui_util.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 void AddIntSyncDetail(ListValue* details, const std::string& stat_name, 212 void AddIntSyncDetail(ListValue* details, const std::string& stat_name,
213 int64 stat_value) { 213 int64 stat_value) {
214 DictionaryValue* val = new DictionaryValue; 214 DictionaryValue* val = new DictionaryValue;
215 val->SetString("stat_name", stat_name); 215 val->SetString("stat_name", stat_name);
216 val->SetString("stat_value", base::FormatNumber(stat_value)); 216 val->SetString("stat_value", base::FormatNumber(stat_value));
217 details->Append(val); 217 details->Append(val);
218 } 218 }
219 219
220 std::wstring ConstructTime(int64 time_in_int) { 220 string16 ConstructTime(int64 time_in_int) {
221 base::Time time = base::Time::FromInternalValue(time_in_int); 221 base::Time time = base::Time::FromInternalValue(time_in_int);
222 222
223 // If time is null the format function returns a time in 1969. 223 // If time is null the format function returns a time in 1969.
224 if (time.is_null()) 224 if (time.is_null())
225 return std::wstring(); 225 return string16();
226 return base::TimeFormatFriendlyDateAndTime(time); 226 return base::TimeFormatFriendlyDateAndTime(time);
227 } 227 }
228 228
229 std::string MakeSyncAuthErrorText( 229 std::string MakeSyncAuthErrorText(
230 const GoogleServiceAuthError::State& state) { 230 const GoogleServiceAuthError::State& state) {
231 switch (state) { 231 switch (state) {
232 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: 232 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS:
233 case GoogleServiceAuthError::ACCOUNT_DELETED: 233 case GoogleServiceAuthError::ACCOUNT_DELETED:
234 case GoogleServiceAuthError::ACCOUNT_DISABLED: 234 case GoogleServiceAuthError::ACCOUNT_DISABLED:
235 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: 235 case GoogleServiceAuthError::SERVICE_UNAVAILABLE:
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 info.bookmarks_added_during_migration); 347 info.bookmarks_added_during_migration);
348 sync_ui_util::AddIntSyncDetail(details, 348 sync_ui_util::AddIntSyncDetail(details,
349 "Autofill entries created during migration", 349 "Autofill entries created during migration",
350 info.autofill_entries_added_during_migration); 350 info.autofill_entries_added_during_migration);
351 sync_ui_util::AddIntSyncDetail(details, 351 sync_ui_util::AddIntSyncDetail(details,
352 "Autofill Profiles created during migration", 352 "Autofill Profiles created during migration",
353 info.autofill_profile_added_during_migration); 353 info.autofill_profile_added_during_migration);
354 354
355 DictionaryValue* val = new DictionaryValue; 355 DictionaryValue* val = new DictionaryValue;
356 val->SetString("stat_name", "Autofill Migration Time"); 356 val->SetString("stat_name", "Autofill Migration Time");
357 val->SetString("stat_value", 357 val->SetString("stat_value", ConstructTime(info.autofill_migration_time));
358 WideToUTF16Hack(
359 ConstructTime(info.autofill_migration_time)));
360 details->Append(val); 358 details->Append(val);
361 } 359 }
362 } 360 }
363 } 361 }
364 362
365 } // namespace sync_ui_util 363 } // namespace sync_ui_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698