| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/importer/external_process_importer_host.h" | 14 #include "chrome/browser/importer/external_process_importer_host.h" |
| 15 #include "chrome/browser/importer/in_process_importer_bridge.h" | 15 #include "chrome/browser/importer/in_process_importer_bridge.h" |
| 16 #include "chrome/common/importer/firefox_importer_utils.h" | 16 #include "chrome/common/importer/firefox_importer_utils.h" |
| 17 #include "chrome/common/importer/imported_bookmark_entry.h" | 17 #include "chrome/common/importer/imported_bookmark_entry.h" |
| 18 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| 19 #include "components/strings/grit/components_strings.h" | 19 #include "components/strings/grit/components_strings.h" |
| 20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/browser/utility_process_host.h" | 21 #include "content/public/browser/utility_process_host.h" |
| 22 #include "services/service_manager/public/cpp/interface_provider.h" | |
| 23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 24 | 23 |
| 25 using content::BrowserThread; | 24 using content::BrowserThread; |
| 26 using content::UtilityProcessHost; | 25 using content::UtilityProcessHost; |
| 27 | 26 |
| 28 ExternalProcessImporterClient::ExternalProcessImporterClient( | 27 ExternalProcessImporterClient::ExternalProcessImporterClient( |
| 29 base::WeakPtr<ExternalProcessImporterHost> importer_host, | 28 base::WeakPtr<ExternalProcessImporterHost> importer_host, |
| 30 const importer::SourceProfile& source_profile, | 29 const importer::SourceProfile& source_profile, |
| 31 uint16_t items, | 30 uint16_t items, |
| 32 InProcessImporterBridge* bridge) | 31 InProcessImporterBridge* bridge) |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 #if defined(OS_MACOSX) | 300 #if defined(OS_MACOSX) |
| 302 base::EnvironmentMap env; | 301 base::EnvironmentMap env; |
| 303 std::string dylib_path = GetFirefoxDylibPath().value(); | 302 std::string dylib_path = GetFirefoxDylibPath().value(); |
| 304 if (!dylib_path.empty()) | 303 if (!dylib_path.empty()) |
| 305 env["DYLD_FALLBACK_LIBRARY_PATH"] = dylib_path; | 304 env["DYLD_FALLBACK_LIBRARY_PATH"] = dylib_path; |
| 306 utility_process_host->SetEnv(env); | 305 utility_process_host->SetEnv(env); |
| 307 #endif | 306 #endif |
| 308 | 307 |
| 309 utility_process_host->Start(); | 308 utility_process_host->Start(); |
| 310 chrome::mojom::ProfileImportPtr profile_import; | 309 chrome::mojom::ProfileImportPtr profile_import; |
| 311 utility_process_host->GetRemoteInterfaces()->GetInterface(std::move(request)); | 310 BindInterface(utility_process_host, std::move(request)); |
| 312 } | 311 } |
| 313 | 312 |
| 314 void ExternalProcessImporterClient::CloseMojoHandles() { | 313 void ExternalProcessImporterClient::CloseMojoHandles() { |
| 315 profile_import_.reset(); | 314 profile_import_.reset(); |
| 316 binding_.Close(); | 315 binding_.Close(); |
| 317 } | 316 } |
| OLD | NEW |