OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/utility/importer/external_process_importer_bridge.h" | 5 #include "chrome/utility/importer/external_process_importer_bridge.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "base/task_runner.h" | 11 #include "base/task_runner.h" |
12 #include "base/values.h" | 12 #include "base/values.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_data_types.h" | 15 #include "chrome/common/importer/importer_data_types.h" |
16 #include "chrome/common/importer/profile_import_process_messages.h" | 16 #include "chrome/common/importer/profile_import_process_messages.h" |
17 #include "content/public/common/password_form.h" | 17 #include "components/autofill/core/common/password_form.h" |
18 #include "ipc/ipc_sender.h" | 18 #include "ipc/ipc_sender.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Rather than sending all import items over IPC at once we chunk them into | 22 // Rather than sending all import items over IPC at once we chunk them into |
23 // separate requests. This avoids the case of a large import causing | 23 // separate requests. This avoids the case of a large import causing |
24 // oversized IPC messages. | 24 // oversized IPC messages. |
25 const int kNumBookmarksToSend = 100; | 25 const int kNumBookmarksToSend = 100; |
26 const int kNumHistoryRowsToSend = 100; | 26 const int kNumHistoryRowsToSend = 100; |
27 const int kNumFaviconsToSend = 100; | 27 const int kNumFaviconsToSend = 100; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 url_keywords, unique_on_host_and_path)); | 130 url_keywords, unique_on_host_and_path)); |
131 } | 131 } |
132 | 132 |
133 void ExternalProcessImporterBridge::SetFirefoxSearchEnginesXMLData( | 133 void ExternalProcessImporterBridge::SetFirefoxSearchEnginesXMLData( |
134 const std::vector<std::string>& search_engine_data) { | 134 const std::vector<std::string>& search_engine_data) { |
135 Send(new ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData( | 135 Send(new ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData( |
136 search_engine_data)); | 136 search_engine_data)); |
137 } | 137 } |
138 | 138 |
139 void ExternalProcessImporterBridge::SetPasswordForm( | 139 void ExternalProcessImporterBridge::SetPasswordForm( |
140 const content::PasswordForm& form) { | 140 const autofill::PasswordForm& form) { |
141 Send(new ProfileImportProcessHostMsg_NotifyPasswordFormReady(form)); | 141 Send(new ProfileImportProcessHostMsg_NotifyPasswordFormReady(form)); |
142 } | 142 } |
143 | 143 |
144 void ExternalProcessImporterBridge::NotifyStarted() { | 144 void ExternalProcessImporterBridge::NotifyStarted() { |
145 Send(new ProfileImportProcessHostMsg_Import_Started()); | 145 Send(new ProfileImportProcessHostMsg_Import_Started()); |
146 } | 146 } |
147 | 147 |
148 void ExternalProcessImporterBridge::NotifyItemStarted( | 148 void ExternalProcessImporterBridge::NotifyItemStarted( |
149 importer::ImportItem item) { | 149 importer::ImportItem item) { |
150 Send(new ProfileImportProcessHostMsg_ImportItem_Started(item)); | 150 Send(new ProfileImportProcessHostMsg_ImportItem_Started(item)); |
(...skipping 19 matching lines...) Expand all Loading... |
170 task_runner_->PostTask( | 170 task_runner_->PostTask( |
171 FROM_HERE, | 171 FROM_HERE, |
172 base::Bind(&ExternalProcessImporterBridge::SendInternal, | 172 base::Bind(&ExternalProcessImporterBridge::SendInternal, |
173 this, message)); | 173 this, message)); |
174 } | 174 } |
175 | 175 |
176 void ExternalProcessImporterBridge::SendInternal(IPC::Message* message) { | 176 void ExternalProcessImporterBridge::SendInternal(IPC::Message* message) { |
177 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 177 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
178 sender_->Send(message); | 178 sender_->Send(message); |
179 } | 179 } |
OLD | NEW |