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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 void ExternalProcessImporterClient::Start() { | 44 void ExternalProcessImporterClient::Start() { |
45 AddRef(); // balanced in Cleanup. | 45 AddRef(); // balanced in Cleanup. |
46 | 46 |
47 chrome::mojom::ProfileImportRequest request(&profile_import_); | 47 chrome::mojom::ProfileImportRequest request(&profile_import_); |
48 | 48 |
49 BrowserThread::ID thread_id; | 49 BrowserThread::ID thread_id; |
50 CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_id)); | 50 CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_id)); |
51 BrowserThread::PostTask( | 51 BrowserThread::PostTask( |
52 BrowserThread::IO, FROM_HERE, | 52 BrowserThread::IO, FROM_HERE, |
53 base::Bind(&ExternalProcessImporterClient::StartProcessOnIOThread, this, | 53 base::BindOnce(&ExternalProcessImporterClient::StartProcessOnIOThread, |
54 thread_id, base::Passed(std::move(request)))); | 54 this, thread_id, base::Passed(std::move(request)))); |
55 | 55 |
56 // Dictionary of all localized strings that could be needed by the importer | 56 // Dictionary of all localized strings that could be needed by the importer |
57 // in the external process. | 57 // in the external process. |
58 auto localized_strings = base::MakeUnique<base::DictionaryValue>(); | 58 auto localized_strings = base::MakeUnique<base::DictionaryValue>(); |
59 localized_strings->SetString(base::IntToString(IDS_BOOKMARK_GROUP), | 59 localized_strings->SetString(base::IntToString(IDS_BOOKMARK_GROUP), |
60 l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP)); | 60 l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP)); |
61 localized_strings->SetString( | 61 localized_strings->SetString( |
62 base::IntToString(IDS_BOOKMARK_GROUP_FROM_FIREFOX), | 62 base::IntToString(IDS_BOOKMARK_GROUP_FROM_FIREFOX), |
63 l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_FIREFOX)); | 63 l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_FIREFOX)); |
64 localized_strings->SetString( | 64 localized_strings->SetString( |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 utility_process_host->Start(); | 308 utility_process_host->Start(); |
309 chrome::mojom::ProfileImportPtr profile_import; | 309 chrome::mojom::ProfileImportPtr profile_import; |
310 BindInterface(utility_process_host, std::move(request)); | 310 BindInterface(utility_process_host, std::move(request)); |
311 } | 311 } |
312 | 312 |
313 void ExternalProcessImporterClient::CloseMojoHandles() { | 313 void ExternalProcessImporterClient::CloseMojoHandles() { |
314 profile_import_.reset(); | 314 profile_import_.reset(); |
315 binding_.Close(); | 315 binding_.Close(); |
316 } | 316 } |
OLD | NEW |