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

Unified Diff: chrome/common/importer/profile_import_process_messages.h

Issue 480953002: Implement "Autofill form data" import for Firefox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test case Created 6 years, 4 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
Index: chrome/common/importer/profile_import_process_messages.h
diff --git a/chrome/common/importer/profile_import_process_messages.h b/chrome/common/importer/profile_import_process_messages.h
index dc09e4d326e05031c8bca011e4aa0b6dccb0a132..ac7dced103e9b78d2dbb8f53c351b5e98479d08d 100644
--- a/chrome/common/importer/profile_import_process_messages.h
+++ b/chrome/common/importer/profile_import_process_messages.h
@@ -12,6 +12,7 @@
#include "chrome/common/common_param_traits_macros.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_autofill_form_data_entry.h"
#include "chrome/common/importer/importer_data_types.h"
#include "chrome/common/importer/importer_url_row.h"
#include "components/autofill/content/common/autofill_param_traits_macros.h"
@@ -220,6 +221,52 @@ struct ParamTraits<importer::URLKeywordInfo> {
}
}; // ParamTraits<importer::URLKeywordInfo>
+// Traits for ImporterAutofillFormDataEntry to pack/unpack.
+template <>
+struct ParamTraits<ImporterAutofillFormDataEntry> {
+ typedef ImporterAutofillFormDataEntry param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.name);
+ WriteParam(m, p.value);
+ WriteParam(m, p.times_used);
+ WriteParam(m, p.first_used);
+ WriteParam(m, p.last_used);
+ }
+ static bool Read(const Message* m, PickleIterator* iter, param_type* p) {
+ base::string16 name;
+ base::string16 value;
+ int times_used;
+ base::Time first_used;
+ base::Time last_used;
+ if (!ReadParam(m, iter, &name) ||
+ !ReadParam(m, iter, &value) ||
+ !ReadParam(m, iter, &times_used) ||
+ !ReadParam(m, iter, &first_used) ||
+ !ReadParam(m, iter, &last_used))
+ return false;
+ *p = ImporterAutofillFormDataEntry();
+ p->name = name;
+ p->value = value;
+ p->times_used = times_used;
+ p->first_used = first_used;
+ p->last_used = last_used;
+ return true;
+ }
+ static void Log(const param_type& p, std::string* l) {
+ l->append("(");
+ LogParam(p.name, l);
+ l->append(", ");
+ LogParam(p.value, l);
+ l->append(", ");
+ LogParam(p.times_used, l);
+ l->append(", ");
+ LogParam(p.first_used, l);
+ l->append(", ");
+ LogParam(p.last_used, l);
+ l->append(")");
+ }
+}; // ParamTraits<ImporterAutofillFormDataEntry>
Ilya Sherman 2014/08/20 05:47:41 Hmm, can you use the IPC_STRUCT_TRAITS_* macros, r
Nikhil 2014/08/20 11:29:17 Changes done for ImporterAutofillFormDataEntry. I'
Ilya Sherman 2014/08/20 20:47:22 Thanks!
+
#if defined(OS_WIN)
// Traits for importer::ImporterIE7PasswordInfo
template <>
@@ -322,6 +369,11 @@ IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady,
IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData,
std::vector<std::string>) // search_engine_data
+IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_AutofillFormDataImportStart,
+ int /* total number of entries to be imported */)
+
+IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_AutofillFormDataImportGroup,
+ std::vector<ImporterAutofillFormDataEntry>)
Ilya Sherman 2014/08/20 05:47:41 nit: Please leave a blank line after this one.
Nikhil 2014/08/20 11:29:17 Done.
#if defined(OS_WIN)
IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyIE7PasswordInfo,
importer::ImporterIE7PasswordInfo) // password_info

Powered by Google App Engine
This is Rietveld 408576698