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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 | 279 |
280 void ExternalProcessImporterClient::StartProcessOnIOThread( | 280 void ExternalProcessImporterClient::StartProcessOnIOThread( |
281 BrowserThread::ID thread_id) { | 281 BrowserThread::ID thread_id) { |
282 utility_process_host_ = UtilityProcessHost::Create( | 282 utility_process_host_ = UtilityProcessHost::Create( |
283 this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()) | 283 this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()) |
284 ->AsWeakPtr(); | 284 ->AsWeakPtr(); |
285 utility_process_host_->DisableSandbox(); | 285 utility_process_host_->DisableSandbox(); |
286 | 286 |
287 #if defined(OS_MACOSX) | 287 #if defined(OS_MACOSX) |
288 base::EnvironmentVector env; | 288 base::EnvironmentMap env; |
289 std::string dylib_path = GetFirefoxDylibPath().value(); | 289 std::string dylib_path = GetFirefoxDylibPath().value(); |
290 if (!dylib_path.empty()) | 290 if (!dylib_path.empty()) |
291 env.push_back(std::make_pair("DYLD_FALLBACK_LIBRARY_PATH", dylib_path)); | 291 env["DYLD_FALLBACK_LIBRARY_PATH"] = dylib_path; |
292 utility_process_host_->SetEnv(env); | 292 utility_process_host_->SetEnv(env); |
293 #endif | 293 #endif |
294 | 294 |
295 // Dictionary of all localized strings that could be needed by the importer | 295 // Dictionary of all localized strings that could be needed by the importer |
296 // in the external process. | 296 // in the external process. |
297 DictionaryValue localized_strings; | 297 DictionaryValue localized_strings; |
298 localized_strings.SetString( | 298 localized_strings.SetString( |
299 base::IntToString(IDS_BOOKMARK_GROUP), | 299 base::IntToString(IDS_BOOKMARK_GROUP), |
300 l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP)); | 300 l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP)); |
301 localized_strings.SetString( | 301 localized_strings.SetString( |
(...skipping 11 matching lines...) Expand all Loading... |
313 localized_strings.SetString( | 313 localized_strings.SetString( |
314 base::IntToString(IDS_IMPORT_FROM_SAFARI), | 314 base::IntToString(IDS_IMPORT_FROM_SAFARI), |
315 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); | 315 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); |
316 localized_strings.SetString( | 316 localized_strings.SetString( |
317 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), | 317 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), |
318 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); | 318 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); |
319 | 319 |
320 utility_process_host_->Send(new ProfileImportProcessMsg_StartImport( | 320 utility_process_host_->Send(new ProfileImportProcessMsg_StartImport( |
321 source_profile_, items_, localized_strings)); | 321 source_profile_, items_, localized_strings)); |
322 } | 322 } |
OLD | NEW |