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

Unified Diff: chrome/browser/importer/external_process_importer_client.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
Index: chrome/browser/importer/external_process_importer_client.cc
diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc
index 43946118733fcafe8c7f70a92ffd91a35b1591fb..523d2f8b952c47fa7a6b536ae316094e810a352a 100644
--- a/chrome/browser/importer/external_process_importer_client.cc
+++ b/chrome/browser/importer/external_process_importer_client.cc
@@ -106,6 +106,10 @@ bool ExternalProcessImporterClient::OnMessageReceived(
OnKeywordsImportReady)
IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData,
OnFirefoxSearchEngineDataReceived)
+ IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_AutofillFormDataImportStart,
+ OnAutofillFormDataImportStart)
+ IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_AutofillFormDataImportGroup,
+ OnAutofillFormDataImportGroup)
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyIE7PasswordInfo,
OnIE7PasswordReceived)
@@ -250,6 +254,28 @@ void ExternalProcessImporterClient::OnFirefoxSearchEngineDataReceived(
bridge_->SetFirefoxSearchEnginesXMLData(search_engine_data);
}
+void ExternalProcessImporterClient::OnAutofillFormDataImportStart(
+ size_t total_autofill_form_data_entry_count) {
+ if (cancelled_)
+ return;
+
+ total_autofill_form_data_entry_count_ = total_autofill_form_data_entry_count;
+ autofill_form_data_.reserve(total_autofill_form_data_entry_count);
+}
+
+void ExternalProcessImporterClient::OnAutofillFormDataImportGroup(
+ const std::vector<ImporterAutofillFormDataEntry>&
+ autofill_form_data_entry_group) {
+ if (cancelled_)
+ return;
+
+ autofill_form_data_.insert(autofill_form_data_.end(),
+ autofill_form_data_entry_group.begin(),
+ autofill_form_data_entry_group.end());
+ if (autofill_form_data_.size() == total_autofill_form_data_entry_count_)
+ bridge_->SetAutofillFormData(autofill_form_data_);
+}
+
#if defined(OS_WIN)
void ExternalProcessImporterClient::OnIE7PasswordReceived(
const importer::ImporterIE7PasswordInfo& importer_password_info) {
« no previous file with comments | « chrome/browser/importer/external_process_importer_client.h ('k') | chrome/browser/importer/firefox_importer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698