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" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 localized_strings->SetString( | 73 localized_strings->SetString( |
74 base::IntToString(IDS_IMPORT_FROM_SAFARI), | 74 base::IntToString(IDS_IMPORT_FROM_SAFARI), |
75 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); | 75 l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI)); |
76 localized_strings->SetString( | 76 localized_strings->SetString( |
77 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), | 77 base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME), |
78 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); | 78 l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME)); |
79 | 79 |
80 // If the utility process hasn't started yet the message will queue until it | 80 // If the utility process hasn't started yet the message will queue until it |
81 // does. | 81 // does. |
82 auto observer_ptr = binding_.CreateInterfacePtrAndBind(); | 82 auto observer_ptr = binding_.CreateInterfacePtrAndBind(); |
83 profile_import_->StartImport(source_profile_, items_, | 83 profile_import_->StartImport(source_profile_, items_, *localized_strings, |
84 std::move(localized_strings), | |
85 std::move(observer_ptr)); | 84 std::move(observer_ptr)); |
86 } | 85 } |
87 | 86 |
88 void ExternalProcessImporterClient::Cancel() { | 87 void ExternalProcessImporterClient::Cancel() { |
89 if (cancelled_) | 88 if (cancelled_) |
90 return; | 89 return; |
91 | 90 |
92 cancelled_ = true; | 91 cancelled_ = true; |
93 profile_import_->CancelImport(); | 92 profile_import_->CancelImport(); |
94 CloseMojoHandles(); | 93 CloseMojoHandles(); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 306 |
308 utility_process_host->Start(); | 307 utility_process_host->Start(); |
309 chrome::mojom::ProfileImportPtr profile_import; | 308 chrome::mojom::ProfileImportPtr profile_import; |
310 BindInterface(utility_process_host, std::move(request)); | 309 BindInterface(utility_process_host, std::move(request)); |
311 } | 310 } |
312 | 311 |
313 void ExternalProcessImporterClient::CloseMojoHandles() { | 312 void ExternalProcessImporterClient::CloseMojoHandles() { |
314 profile_import_.reset(); | 313 profile_import_.reset(); |
315 binding_.Close(); | 314 binding_.Close(); |
316 } | 315 } |
OLD | NEW |