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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/importer/external_process_importer_client.h" | 10 #include "chrome/browser/importer/external_process_importer_client.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 observer_->ImportItemStarted(item); | 77 observer_->ImportItemStarted(item); |
78 } | 78 } |
79 | 79 |
80 void ExternalProcessImporterHost::NotifyImportItemEnded( | 80 void ExternalProcessImporterHost::NotifyImportItemEnded( |
81 importer::ImportItem item) { | 81 importer::ImportItem item) { |
82 if (observer_) | 82 if (observer_) |
83 observer_->ImportItemEnded(item); | 83 observer_->ImportItemEnded(item); |
84 } | 84 } |
85 | 85 |
86 void ExternalProcessImporterHost::NotifyImportEnded() { | 86 void ExternalProcessImporterHost::NotifyImportEnded() { |
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 87 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
88 firefox_lock_.reset(); | 88 firefox_lock_.reset(); |
89 if (observer_) | 89 if (observer_) |
90 observer_->ImportEnded(); | 90 observer_->ImportEnded(); |
91 delete this; | 91 delete this; |
92 } | 92 } |
93 | 93 |
94 ExternalProcessImporterHost::~ExternalProcessImporterHost() { | 94 ExternalProcessImporterHost::~ExternalProcessImporterHost() { |
95 if (installed_bookmark_observer_) { | 95 if (installed_bookmark_observer_) { |
96 DCHECK(profile_); | 96 DCHECK(profile_); |
97 BookmarkModelFactory::GetForProfile(profile_)->RemoveObserver(this); | 97 BookmarkModelFactory::GetForProfile(profile_)->RemoveObserver(this); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 if (!writer_->TemplateURLServiceIsLoaded()) { | 204 if (!writer_->TemplateURLServiceIsLoaded()) { |
205 TemplateURLService* model = | 205 TemplateURLService* model = |
206 TemplateURLServiceFactory::GetForProfile(profile_); | 206 TemplateURLServiceFactory::GetForProfile(profile_); |
207 template_service_subscription_ = model->RegisterOnLoadedCallback( | 207 template_service_subscription_ = model->RegisterOnLoadedCallback( |
208 base::Bind(&ExternalProcessImporterHost::OnTemplateURLServiceLoaded, | 208 base::Bind(&ExternalProcessImporterHost::OnTemplateURLServiceLoaded, |
209 weak_ptr_factory_.GetWeakPtr())); | 209 weak_ptr_factory_.GetWeakPtr())); |
210 model->Load(); | 210 model->Load(); |
211 } | 211 } |
212 } | 212 } |
213 } | 213 } |
OLD | NEW |