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/browser/importer/external_process_importer_bridge.h" | 5 #include "chrome/browser/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/browser/bookmarks/imported_bookmark_entry.h" | 13 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" |
14 #include "chrome/browser/favicon/imported_favicon_usage.h" | 14 #include "chrome/browser/favicon/imported_favicon_usage.h" |
| 15 #include "chrome/browser/importer/importer_data_types.h" |
15 #include "chrome/browser/importer/profile_import_process_messages.h" | 16 #include "chrome/browser/importer/profile_import_process_messages.h" |
16 #include "content/public/common/password_form.h" | 17 #include "content/public/common/password_form.h" |
17 #include "ipc/ipc_sender.h" | 18 #include "ipc/ipc_sender.h" |
18 | 19 |
19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
20 #include "components/webdata/encryptor/ie7_password.h" | 21 #include "components/webdata/encryptor/ie7_password.h" |
21 #endif | 22 #endif |
22 | 23 |
23 namespace { | 24 namespace { |
24 | 25 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 120 |
120 Send(new ProfileImportProcessHostMsg_NotifyHistoryImportGroup( | 121 Send(new ProfileImportProcessHostMsg_NotifyHistoryImportGroup( |
121 row_group, visit_source)); | 122 row_group, visit_source)); |
122 rows_left -= end_group - it; | 123 rows_left -= end_group - it; |
123 it = end_group; | 124 it = end_group; |
124 } | 125 } |
125 DCHECK_EQ(0, rows_left); | 126 DCHECK_EQ(0, rows_left); |
126 } | 127 } |
127 | 128 |
128 void ExternalProcessImporterBridge::SetKeywords( | 129 void ExternalProcessImporterBridge::SetKeywords( |
129 const std::vector<TemplateURL*>& template_urls, | 130 const std::vector<importer::URLKeywordInfo>& url_keywords, |
130 bool unique_on_host_and_path) { | 131 bool unique_on_host_and_path) { |
131 Send(new ProfileImportProcessHostMsg_NotifyKeywordsReady(template_urls, | 132 Send(new ProfileImportProcessHostMsg_NotifyKeywordsReady( |
132 unique_on_host_and_path)); | 133 url_keywords, unique_on_host_and_path)); |
133 STLDeleteContainerPointers(template_urls.begin(), template_urls.end()); | 134 } |
| 135 |
| 136 void ExternalProcessImporterBridge::SetFirefoxSearchEnginesXMLData( |
| 137 const std::vector<std::string>& search_engine_data) { |
| 138 Send(new ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData( |
| 139 search_engine_data)); |
134 } | 140 } |
135 | 141 |
136 void ExternalProcessImporterBridge::SetPasswordForm( | 142 void ExternalProcessImporterBridge::SetPasswordForm( |
137 const content::PasswordForm& form) { | 143 const content::PasswordForm& form) { |
138 Send(new ProfileImportProcessHostMsg_NotifyPasswordFormReady(form)); | 144 Send(new ProfileImportProcessHostMsg_NotifyPasswordFormReady(form)); |
139 } | 145 } |
140 | 146 |
141 void ExternalProcessImporterBridge::NotifyStarted() { | 147 void ExternalProcessImporterBridge::NotifyStarted() { |
142 Send(new ProfileImportProcessHostMsg_Import_Started()); | 148 Send(new ProfileImportProcessHostMsg_Import_Started()); |
143 } | 149 } |
(...skipping 23 matching lines...) Expand all Loading... |
167 task_runner_->PostTask( | 173 task_runner_->PostTask( |
168 FROM_HERE, | 174 FROM_HERE, |
169 base::Bind(&ExternalProcessImporterBridge::SendInternal, | 175 base::Bind(&ExternalProcessImporterBridge::SendInternal, |
170 this, message)); | 176 this, message)); |
171 } | 177 } |
172 | 178 |
173 void ExternalProcessImporterBridge::SendInternal(IPC::Message* message) { | 179 void ExternalProcessImporterBridge::SendInternal(IPC::Message* message) { |
174 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 180 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
175 sender_->Send(message); | 181 sender_->Send(message); |
176 } | 182 } |
OLD | NEW |