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

Unified Diff: chrome/browser/importer/in_process_importer_bridge.cc

Issue 480953002: Implement "Autofill form data" import for Firefox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback (nit fixes, ipc msg changes) 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/browser/importer/in_process_importer_bridge.cc
diff --git a/chrome/browser/importer/in_process_importer_bridge.cc b/chrome/browser/importer/in_process_importer_bridge.cc
index a2ce2b082bf736751a5a418cf10b16b5f4a9a4d5..a1e1488657e977307853ba53d7ad01be9c12de0f 100644
--- a/chrome/browser/importer/in_process_importer_bridge.cc
+++ b/chrome/browser/importer/in_process_importer_bridge.cc
@@ -12,6 +12,8 @@
#include "chrome/browser/search_engines/ui_thread_search_terms_data.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"
Ilya Sherman 2014/08/20 20:47:23 nit: Please alphabetize.
Nikhil 2014/08/21 07:35:36 Hmm, this looks to be correct. c/c/i/imported_* c
+#include "components/autofill/core/browser/webdata/autofill_entry.h"
#include "components/autofill/core/common/password_form.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_parser.h"
@@ -254,6 +256,23 @@ void InProcessImporterBridge::SetPasswordForm(
base::Bind(&ProfileWriter::AddPasswordForm, writer_, form));
}
+void InProcessImporterBridge::SetAutofillFormData(
+ const std::vector<ImporterAutofillFormDataEntry>& entries) {
+ std::vector<autofill::AutofillEntry> autofill_entries;
+ for (size_t i = 0; i < entries.size(); ++i) {
+ autofill_entries.push_back(autofill::AutofillEntry(
+ autofill::AutofillKey(entries[i].name, entries[i].value),
+ entries[i].first_used,
+ entries[i].last_used));
+ }
+
+ BrowserThread::PostTask(BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&ProfileWriter::AddAutofillFormDataEntries,
+ writer_,
+ autofill_entries));
+}
+
void InProcessImporterBridge::NotifyStarted() {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698