OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( | 367 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( |
368 printer_name)); | 368 printer_name)); |
369 } | 369 } |
370 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 370 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
371 } | 371 } |
372 | 372 |
373 void ChromeContentUtilityClient::OnImportStart( | 373 void ChromeContentUtilityClient::OnImportStart( |
374 const importer::SourceProfile& source_profile, | 374 const importer::SourceProfile& source_profile, |
375 uint16 items, | 375 uint16 items, |
376 const DictionaryValue& localized_strings) { | 376 const DictionaryValue& localized_strings) { |
377 bridge_ = new ExternalProcessImporterBridge(localized_strings); | 377 bridge_ = new ExternalProcessImporterBridge( |
| 378 localized_strings, content::UtilityThread::Get()); |
378 importer_ = importer::CreateImporterByType(source_profile.importer_type); | 379 importer_ = importer::CreateImporterByType(source_profile.importer_type); |
379 if (!importer_) { | 380 if (!importer_) { |
380 Send(new ProfileImportProcessHostMsg_Import_Finished(false, | 381 Send(new ProfileImportProcessHostMsg_Import_Finished(false, |
381 "Importer could not be created.")); | 382 "Importer could not be created.")); |
382 return; | 383 return; |
383 } | 384 } |
384 | 385 |
385 items_to_import_ = items; | 386 items_to_import_ = items; |
386 | 387 |
387 // Create worker thread in which importer runs. | 388 // Create worker thread in which importer runs. |
(...skipping 27 matching lines...) Expand all Loading... |
415 | 416 |
416 void ChromeContentUtilityClient::ImporterCleanup() { | 417 void ChromeContentUtilityClient::ImporterCleanup() { |
417 importer_->Cancel(); | 418 importer_->Cancel(); |
418 importer_ = NULL; | 419 importer_ = NULL; |
419 bridge_ = NULL; | 420 bridge_ = NULL; |
420 import_thread_.reset(); | 421 import_thread_.reset(); |
421 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 422 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
422 } | 423 } |
423 | 424 |
424 } // namespace chrome | 425 } // namespace chrome |
OLD | NEW |