Chromium Code Reviews| 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..f38d70d7adb88a3e7d03a92ad9651ae8e8458699 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, ×_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; |
|
Ilya Sherman
2014/09/04 06:17:47
I think you can simplify this to look more like th
Nikhil
2014/09/04 06:34:30
Done.
|
| + } |
| + 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> |
| + |
| #if defined(OS_WIN) |
| // Traits for importer::ImporterIE7PasswordInfo |
| template <> |
| @@ -322,6 +369,12 @@ 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>) |
| + |
| #if defined(OS_WIN) |
| IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyIE7PasswordInfo, |
| importer::ImporterIE7PasswordInfo) // password_info |