OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Multiply-included message file, no traditonal include guard. | 5 // Multiply-included message file, no traditonal include guard. |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/common/common_param_traits_macros.h" | 12 #include "chrome/common/common_param_traits_macros.h" |
13 #include "chrome/common/importer/imported_bookmark_entry.h" | 13 #include "chrome/common/importer/imported_bookmark_entry.h" |
14 #include "chrome/common/importer/imported_favicon_usage.h" | 14 #include "chrome/common/importer/imported_favicon_usage.h" |
| 15 #include "chrome/common/importer/importer_autofill_form_data_entry.h" |
15 #include "chrome/common/importer/importer_data_types.h" | 16 #include "chrome/common/importer/importer_data_types.h" |
16 #include "chrome/common/importer/importer_url_row.h" | 17 #include "chrome/common/importer/importer_url_row.h" |
17 #include "components/autofill/content/common/autofill_param_traits_macros.h" | 18 #include "components/autofill/content/common/autofill_param_traits_macros.h" |
18 #include "components/autofill/core/common/password_form.h" | 19 #include "components/autofill/core/common/password_form.h" |
19 #include "content/public/common/common_param_traits.h" | 20 #include "content/public/common/common_param_traits.h" |
20 #include "ipc/ipc_message_macros.h" | 21 #include "ipc/ipc_message_macros.h" |
21 #include "ipc/ipc_message_utils.h" | 22 #include "ipc/ipc_message_utils.h" |
22 | 23 |
23 #ifndef CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ | 24 #ifndef CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ |
24 #define CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ | 25 #define CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 l->append("("); | 214 l->append("("); |
214 LogParam(p.url, l); | 215 LogParam(p.url, l); |
215 l->append(", "); | 216 l->append(", "); |
216 LogParam(p.keyword, l); | 217 LogParam(p.keyword, l); |
217 l->append(", "); | 218 l->append(", "); |
218 LogParam(p.display_name, l); | 219 LogParam(p.display_name, l); |
219 l->append(")"); | 220 l->append(")"); |
220 } | 221 } |
221 }; // ParamTraits<importer::URLKeywordInfo> | 222 }; // ParamTraits<importer::URLKeywordInfo> |
222 | 223 |
| 224 // Traits for ImporterAutofillFormDataEntry to pack/unpack. |
| 225 template <> |
| 226 struct ParamTraits<ImporterAutofillFormDataEntry> { |
| 227 typedef ImporterAutofillFormDataEntry param_type; |
| 228 static void Write(Message* m, const param_type& p) { |
| 229 WriteParam(m, p.name); |
| 230 WriteParam(m, p.value); |
| 231 WriteParam(m, p.times_used); |
| 232 WriteParam(m, p.first_used); |
| 233 WriteParam(m, p.last_used); |
| 234 } |
| 235 static bool Read(const Message* m, PickleIterator* iter, param_type* p) { |
| 236 return |
| 237 (ReadParam(m, iter, &p->name)) && |
| 238 (ReadParam(m, iter, &p->value)) && |
| 239 (ReadParam(m, iter, &p->times_used)) && |
| 240 (ReadParam(m, iter, &p->first_used)) && |
| 241 (ReadParam(m, iter, &p->last_used)); |
| 242 } |
| 243 static void Log(const param_type& p, std::string* l) { |
| 244 l->append("("); |
| 245 LogParam(p.name, l); |
| 246 l->append(", "); |
| 247 LogParam(p.value, l); |
| 248 l->append(", "); |
| 249 LogParam(p.times_used, l); |
| 250 l->append(", "); |
| 251 LogParam(p.first_used, l); |
| 252 l->append(", "); |
| 253 LogParam(p.last_used, l); |
| 254 l->append(")"); |
| 255 } |
| 256 }; // ParamTraits<ImporterAutofillFormDataEntry> |
| 257 |
223 #if defined(OS_WIN) | 258 #if defined(OS_WIN) |
224 // Traits for importer::ImporterIE7PasswordInfo | 259 // Traits for importer::ImporterIE7PasswordInfo |
225 template <> | 260 template <> |
226 struct ParamTraits<importer::ImporterIE7PasswordInfo> { | 261 struct ParamTraits<importer::ImporterIE7PasswordInfo> { |
227 typedef importer::ImporterIE7PasswordInfo param_type; | 262 typedef importer::ImporterIE7PasswordInfo param_type; |
228 static void Write(Message* m, const param_type& p) { | 263 static void Write(Message* m, const param_type& p) { |
229 WriteParam(m, p.url_hash); | 264 WriteParam(m, p.url_hash); |
230 WriteParam(m, p.encrypted_data); | 265 WriteParam(m, p.encrypted_data); |
231 WriteParam(m, p.date_created); | 266 WriteParam(m, p.date_created); |
232 } | 267 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, | 350 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, |
316 autofill::PasswordForm) | 351 autofill::PasswordForm) |
317 | 352 |
318 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady, | 353 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady, |
319 std::vector<importer::URLKeywordInfo>, // url_keywords | 354 std::vector<importer::URLKeywordInfo>, // url_keywords |
320 bool /* unique on host and path */) | 355 bool /* unique on host and path */) |
321 | 356 |
322 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData, | 357 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData, |
323 std::vector<std::string>) // search_engine_data | 358 std::vector<std::string>) // search_engine_data |
324 | 359 |
| 360 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_AutofillFormDataImportStart, |
| 361 int /* total number of entries to be imported */) |
| 362 |
| 363 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_AutofillFormDataImportGroup, |
| 364 std::vector<ImporterAutofillFormDataEntry>) |
| 365 |
325 #if defined(OS_WIN) | 366 #if defined(OS_WIN) |
326 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyIE7PasswordInfo, | 367 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyIE7PasswordInfo, |
327 importer::ImporterIE7PasswordInfo) // password_info | 368 importer::ImporterIE7PasswordInfo) // password_info |
328 #endif | 369 #endif |
OLD | NEW |