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

Unified Diff: chrome/browser/sync/sync_ui_util.cc

Issue 5159001: Rest of the autofill work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: autofill changes. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/sync_ui_util.cc
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index 2b20eda004441ee6e3cad70b278f721e46cc2408..992ad651fad45192bf5444d863f26a85a7a72322 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -6,6 +6,7 @@
#include "app/l10n_util.h"
#include "base/i18n/number_formatting.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -215,6 +216,35 @@ void AddIntSyncDetail(ListValue* details, const std::string& stat_name,
details->Append(val);
}
+std::string ConstructTime(int64 time_in_int) {
tim (not reviewing) 2010/12/15 20:11:42 see time_formatting.h I think what you want is ei
lipalani 2010/12/15 21:28:15 Done.
+ base::Time time = base::Time::FromInternalValue(time_in_int);
+ if (time.is_null())
+ return std::string();
+ base::Time::Exploded exploded;
+ time.LocalExplode(&exploded);
+
+ std::string time_in_string;
+ time_in_string.append(UTF16ToUTF8(
+ base::FormatNumber(static_cast<int64>(exploded.month))));
+ time_in_string.append("-");
+ time_in_string.append(UTF16ToUTF8(base::FormatNumber(
+ static_cast<int64>(exploded.day_of_month))));
+ time_in_string.append("-");
+ time_in_string.append(UTF16ToUTF8(base::FormatNumber(
+ static_cast<int64>(exploded.year))));
+ time_in_string.append(" ");
+ time_in_string.append(UTF16ToUTF8(base::FormatNumber(
+ static_cast<int64>(exploded.hour))));
+ time_in_string.append(":");
+ time_in_string.append(UTF16ToUTF8(base::FormatNumber(
+ static_cast<int64>(exploded.minute))));
+ time_in_string.append(":");
+ time_in_string.append(UTF16ToUTF8(base::FormatNumber(
+ static_cast<int64>(exploded.second))));
+
+ return time_in_string;
+}
+
std::string MakeSyncAuthErrorText(
const GoogleServiceAuthError::State& state) {
switch (state) {
@@ -323,6 +353,28 @@ void ConstructAboutInformation(ProfileSyncService* service,
val->SetString("group", ModelSafeGroupToString(it->second));
routing_info->Append(val);
}
+
+ sync_ui_util::AddBoolSyncDetail(details,
+ "Autofill Migrated",
+ service->backend()->GetAutofillMigrationState() ==
+ syncable::MIGRATED);
+ syncable::AutofillMigrationDebugInfo info =
+ service->backend()->GetAutofillMigrationDebugInfo();
+
+ sync_ui_util::AddIntSyncDetail(details,
+ "Bookmarks created during migration",
+ info.bookmarks_added_during_migration);
+ sync_ui_util::AddIntSyncDetail(details,
+ "Autofill entries created during migration",
+ info.autofill_entries_added_during_migration);
+ sync_ui_util::AddIntSyncDetail(details,
+ "Autofill Profiles created during migration",
+ info.autofill_profile_added_during_migration);
+
+ DictionaryValue* val = new DictionaryValue;
+ val->SetString("stat_name", "Autofill Migration Time");
+ val->SetString("stat_value", ConstructTime(info.autofill_migration_time));
+ details->Append(val);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698