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

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 (simplify Read method) Created 6 years, 3 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 | « chrome/browser/importer/in_process_importer_bridge.h ('k') | chrome/browser/importer/profile_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 61480ae90ffa6cc2d5452592446cb4c01869edef..c5c5927af84fdb7fc309236144633a70690a5ff6 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"
+#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,
« no previous file with comments | « chrome/browser/importer/in_process_importer_bridge.h ('k') | chrome/browser/importer/profile_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698