| 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" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 importer::ImportItem import_item) { | 305 importer::ImportItem import_item) { |
| 306 utility_process_host_->Send( | 306 utility_process_host_->Send( |
| 307 new ProfileImportProcessMsg_ReportImportItemFinished(import_item)); | 307 new ProfileImportProcessMsg_ReportImportItemFinished(import_item)); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void ExternalProcessImporterClient::StartProcessOnIOThread( | 310 void ExternalProcessImporterClient::StartProcessOnIOThread( |
| 311 BrowserThread::ID thread_id) { | 311 BrowserThread::ID thread_id) { |
| 312 utility_process_host_ = UtilityProcessHost::Create( | 312 utility_process_host_ = UtilityProcessHost::Create( |
| 313 this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()) | 313 this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()) |
| 314 ->AsWeakPtr(); | 314 ->AsWeakPtr(); |
| 315 utility_process_host_->SetName(l10n_util::GetStringUTF16( |
| 316 IDS_UTILITY_PROCESS_PROFILE_IMPORTER_NAME)); |
| 315 utility_process_host_->DisableSandbox(); | 317 utility_process_host_->DisableSandbox(); |
| 316 | 318 |
| 317 #if defined(OS_MACOSX) | 319 #if defined(OS_MACOSX) |
| 318 base::EnvironmentMap env; | 320 base::EnvironmentMap env; |
| 319 std::string dylib_path = GetFirefoxDylibPath().value(); | 321 std::string dylib_path = GetFirefoxDylibPath().value(); |
| 320 if (!dylib_path.empty()) | 322 if (!dylib_path.empty()) |
| 321 env["DYLD_FALLBACK_LIBRARY_PATH"] = dylib_path; | 323 env["DYLD_FALLBACK_LIBRARY_PATH"] = dylib_path; |
| 322 utility_process_host_->SetEnv(env); | 324 utility_process_host_->SetEnv(env); |
| 323 #endif | 325 #endif |
| 324 | 326 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 343 localized_strings.SetString( | 345 localized_strings.SetString( |
| 344 base::IntToString(IDS_IMPORT_FROM_SAFARI), | 346 base::IntToString(IDS_IMPORT_FROM_SAFARI), |
| 345 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); | 347 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); |
| 346 localized_strings.SetString( | 348 localized_strings.SetString( |
| 347 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), | 349 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), |
| 348 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); | 350 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); |
| 349 | 351 |
| 350 utility_process_host_->Send(new ProfileImportProcessMsg_StartImport( | 352 utility_process_host_->Send(new ProfileImportProcessMsg_StartImport( |
| 351 source_profile_, items_, localized_strings)); | 353 source_profile_, items_, localized_strings)); |
| 352 } | 354 } |
| OLD | NEW |