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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 importer::ImportItem item) { | 82 importer::ImportItem item) { |
83 if (observer_) | 83 if (observer_) |
84 observer_->ImportItemEnded(item); | 84 observer_->ImportItemEnded(item); |
85 } | 85 } |
86 | 86 |
87 void ExternalProcessImporterHost::NotifyImportEnded() { | 87 void ExternalProcessImporterHost::NotifyImportEnded() { |
88 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 88 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
89 firefox_lock_.reset(); | 89 firefox_lock_.reset(); |
90 if (observer_) | 90 if (observer_) |
91 observer_->ImportEnded(); | 91 observer_->ImportEnded(); |
| 92 importer::HideImportLockDialog(); |
92 delete this; | 93 delete this; |
93 } | 94 } |
94 | 95 |
95 ExternalProcessImporterHost::~ExternalProcessImporterHost() { | 96 ExternalProcessImporterHost::~ExternalProcessImporterHost() { |
96 if (installed_bookmark_observer_) { | 97 if (installed_bookmark_observer_) { |
97 DCHECK(profile_); | 98 DCHECK(profile_); |
98 BookmarkModelFactory::GetForBrowserContext(profile_)->RemoveObserver(this); | 99 BookmarkModelFactory::GetForBrowserContext(profile_)->RemoveObserver(this); |
99 } | 100 } |
100 } | 101 } |
101 | 102 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (!writer_->TemplateURLServiceIsLoaded()) { | 206 if (!writer_->TemplateURLServiceIsLoaded()) { |
206 TemplateURLService* model = | 207 TemplateURLService* model = |
207 TemplateURLServiceFactory::GetForProfile(profile_); | 208 TemplateURLServiceFactory::GetForProfile(profile_); |
208 template_service_subscription_ = model->RegisterOnLoadedCallback( | 209 template_service_subscription_ = model->RegisterOnLoadedCallback( |
209 base::Bind(&ExternalProcessImporterHost::OnTemplateURLServiceLoaded, | 210 base::Bind(&ExternalProcessImporterHost::OnTemplateURLServiceLoaded, |
210 weak_ptr_factory_.GetWeakPtr())); | 211 weak_ptr_factory_.GetWeakPtr())); |
211 model->Load(); | 212 model->Load(); |
212 } | 213 } |
213 } | 214 } |
214 } | 215 } |
OLD | NEW |