| 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_client.h" | 5 #include "chrome/browser/importer/external_process_importer_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/importer/external_process_importer_host.h" | 10 #include "chrome/browser/importer/external_process_importer_host.h" |
| 11 #include "chrome/browser/importer/firefox_importer_utils.h" | |
| 12 #include "chrome/browser/importer/in_process_importer_bridge.h" | 11 #include "chrome/browser/importer/in_process_importer_bridge.h" |
| 12 #include "chrome/common/importer/firefox_importer_utils.h" |
| 13 #include "chrome/common/importer/imported_bookmark_entry.h" | 13 #include "chrome/common/importer/imported_bookmark_entry.h" |
| 14 #include "chrome/common/importer/profile_import_process_messages.h" | 14 #include "chrome/common/importer/profile_import_process_messages.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/utility_process_host.h" | 16 #include "content/public/browser/utility_process_host.h" |
| 17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 using content::UtilityProcessHost; | 21 using content::UtilityProcessHost; |
| 22 | 22 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void ExternalProcessImporterClient::OnHistoryImportGroup( | 161 void ExternalProcessImporterClient::OnHistoryImportGroup( |
| 162 const std::vector<ImporterURLRow>& history_rows_group, | 162 const std::vector<ImporterURLRow>& history_rows_group, |
| 163 int visit_source) { | 163 int visit_source) { |
| 164 if (cancelled_) | 164 if (cancelled_) |
| 165 return; | 165 return; |
| 166 | 166 |
| 167 history_rows_.insert(history_rows_.end(), history_rows_group.begin(), | 167 history_rows_.insert(history_rows_.end(), history_rows_group.begin(), |
| 168 history_rows_group.end()); | 168 history_rows_group.end()); |
| 169 if (history_rows_.size() == total_history_rows_count_) | 169 if (history_rows_.size() == total_history_rows_count_) |
| 170 bridge_->SetHistoryItems(history_rows_, | 170 bridge_->SetHistoryItems(history_rows_, |
| 171 static_cast<history::VisitSource>(visit_source)); | 171 static_cast<ImporterVisitSource>(visit_source)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void ExternalProcessImporterClient::OnHomePageImportReady( | 174 void ExternalProcessImporterClient::OnHomePageImportReady( |
| 175 const GURL& home_page) { | 175 const GURL& home_page) { |
| 176 if (cancelled_) | 176 if (cancelled_) |
| 177 return; | 177 return; |
| 178 | 178 |
| 179 bridge_->AddHomePage(home_page); | 179 bridge_->AddHomePage(home_page); |
| 180 } | 180 } |
| 181 | 181 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 localized_strings.SetString( | 307 localized_strings.SetString( |
| 308 base::IntToString(IDS_IMPORT_FROM_SAFARI), | 308 base::IntToString(IDS_IMPORT_FROM_SAFARI), |
| 309 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); | 309 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); |
| 310 localized_strings.SetString( | 310 localized_strings.SetString( |
| 311 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), | 311 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), |
| 312 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); | 312 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); |
| 313 | 313 |
| 314 utility_process_host_->Send(new ProfileImportProcessMsg_StartImport( | 314 utility_process_host_->Send(new ProfileImportProcessMsg_StartImport( |
| 315 source_profile_, items_, localized_strings)); | 315 source_profile_, items_, localized_strings)); |
| 316 } | 316 } |
| OLD | NEW |