| 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_host.h" | 5 #include "chrome/browser/importer/external_process_importer_host.h" |
| 6 | 6 |
| 7 #include "chrome/browser/bookmarks/bookmark_model.h" | 7 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 8 #include "chrome/browser/importer/external_process_importer_client.h" | 8 #include "chrome/browser/importer/external_process_importer_client.h" |
| 9 #include "chrome/browser/importer/in_process_importer_bridge.h" | 9 #include "chrome/browser/importer/in_process_importer_bridge.h" |
| 10 | 10 |
| 11 ExternalProcessImporterHost::ExternalProcessImporterHost() | 11 ExternalProcessImporterHost::ExternalProcessImporterHost() |
| 12 : client_(NULL), | 12 : client_(NULL), |
| 13 source_profile_(NULL), | 13 source_profile_(NULL), |
| 14 items_(0), | 14 items_(0), |
| 15 cancelled_(false), | 15 cancelled_(false), |
| 16 import_process_launched_(false) { | 16 import_process_launched_(false) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 void ExternalProcessImporterHost::Cancel() { | 19 void ExternalProcessImporterHost::Cancel() { |
| 20 cancelled_ = true; | 20 cancelled_ = true; |
| 21 if (import_process_launched_) | 21 if (import_process_launched_) |
| 22 client_->Cancel(); | 22 client_->Cancel(); |
| 23 NotifyImportEnded(); // Tells the observer that we're done, and releases us. | 23 NotifyImportEnded(); // Tells the observer that we're done, and releases us. |
| 24 } | 24 } |
| 25 | 25 |
| 26 ExternalProcessImporterHost::~ExternalProcessImporterHost() {} |
| 27 |
| 26 void ExternalProcessImporterHost::StartImportSettings( | 28 void ExternalProcessImporterHost::StartImportSettings( |
| 27 const importer::SourceProfile& source_profile, | 29 const importer::SourceProfile& source_profile, |
| 28 Profile* target_profile, | 30 Profile* target_profile, |
| 29 uint16 items, | 31 uint16 items, |
| 30 ProfileWriter* writer, | 32 ProfileWriter* writer, |
| 31 bool first_run) { | 33 bool first_run) { |
| 32 // We really only support importing from one host at a time. | 34 // We really only support importing from one host at a time. |
| 33 DCHECK(!profile_); | 35 DCHECK(!profile_); |
| 34 DCHECK(target_profile); | 36 DCHECK(target_profile); |
| 35 | 37 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 66 | 68 |
| 67 void ExternalProcessImporterHost::Loaded(BookmarkModel* model, | 69 void ExternalProcessImporterHost::Loaded(BookmarkModel* model, |
| 68 bool ids_reassigned) { | 70 bool ids_reassigned) { |
| 69 DCHECK(model->IsLoaded()); | 71 DCHECK(model->IsLoaded()); |
| 70 model->RemoveObserver(this); | 72 model->RemoveObserver(this); |
| 71 waiting_for_bookmarkbar_model_ = false; | 73 waiting_for_bookmarkbar_model_ = false; |
| 72 installed_bookmark_observer_ = false; | 74 installed_bookmark_observer_ = false; |
| 73 | 75 |
| 74 InvokeTaskIfDone(); | 76 InvokeTaskIfDone(); |
| 75 } | 77 } |
| OLD | NEW |