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

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.cc

Issue 316243002: Add date_synced to PasswordForm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +comment Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/native_backend_gnome_x.cc
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc
index 24622f65e72d871d420e9524b3ad345e17379034..6b4236a0c25c1e02c5949a749c542d8a4de0bd03 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x.cc
@@ -137,6 +137,9 @@ scoped_ptr<PasswordForm> FormFromAttributes(GnomeKeyringAttributeList* attrs) {
form->type = static_cast<PasswordForm::Type>(uint_attr_map["type"]);
form->times_used = uint_attr_map["times_used"];
form->scheme = static_cast<PasswordForm::Scheme>(uint_attr_map["scheme"]);
+ int64 date_synced = 0;
+ base::StringToInt64(string_attr_map["date_synced"], &date_synced);
+ form->date_synced = base::Time::FromInternalValue(date_synced);
return form.Pass();
}
@@ -218,6 +221,7 @@ const GnomeKeyringPasswordSchema kGnomeSchema = {
{ "scheme", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
{ "type", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
{ "times_used", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
+ { "date_synced", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
// This field is always "chrome" so that we can search for it.
{ "application", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
{ NULL }
@@ -312,6 +316,7 @@ void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) {
// We don't want to actually save passwords as though on January 1, 1970.
if (!date_created)
date_created = time(NULL);
+ int64 date_synced = form.date_synced.ToInternalValue();
gnome_keyring_store_password(
&kGnomeSchema,
NULL, // Default keyring.
@@ -334,6 +339,7 @@ void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) {
"type", form.type,
"times_used", form.times_used,
"scheme", form.scheme,
+ "date_synced", base::Int64ToString(date_synced).c_str(),
"application", app_string,
NULL);
}
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698