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/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data_remover.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (remove_origin_.is_empty()) { | 233 if (remove_origin_.is_empty()) { |
234 // We also delete the list of recently closed tabs. Since these expire, | 234 // We also delete the list of recently closed tabs. Since these expire, |
235 // they can't be more than a day old, so we can simply clear them all. | 235 // they can't be more than a day old, so we can simply clear them all. |
236 TabRestoreService* tab_service = | 236 TabRestoreService* tab_service = |
237 TabRestoreServiceFactory::GetForProfile(profile_); | 237 TabRestoreServiceFactory::GetForProfile(profile_); |
238 if (tab_service) { | 238 if (tab_service) { |
239 tab_service->ClearEntries(); | 239 tab_service->ClearEntries(); |
240 tab_service->DeleteLastSession(); | 240 tab_service->DeleteLastSession(); |
241 } | 241 } |
242 | 242 |
| 243 #if defined(ENABLE_SESSION_SERVICE) |
243 // We also delete the last session when we delete the history. | 244 // We also delete the last session when we delete the history. |
244 SessionService* session_service = | 245 SessionService* session_service = |
245 SessionServiceFactory::GetForProfile(profile_); | 246 SessionServiceFactory::GetForProfile(profile_); |
246 if (session_service) | 247 if (session_service) |
247 session_service->DeleteLastSession(); | 248 session_service->DeleteLastSession(); |
| 249 #endif |
248 } | 250 } |
249 } | 251 } |
250 | 252 |
251 if (remove_mask & REMOVE_DOWNLOADS) { | 253 if (remove_mask & REMOVE_DOWNLOADS) { |
252 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); | 254 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); |
253 DownloadManager* download_manager = | 255 DownloadManager* download_manager = |
254 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); | 256 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); |
255 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); | 257 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); |
256 download_manager->ClearLastDownloadPath(); | 258 download_manager->ClearLastDownloadPath(); |
257 } | 259 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 BrowserThread::UI, FROM_HERE, | 708 BrowserThread::UI, FROM_HERE, |
707 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, | 709 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, |
708 base::Unretained(this))); | 710 base::Unretained(this))); |
709 } | 711 } |
710 | 712 |
711 void BrowsingDataRemover::OnClearedServerBoundCerts() { | 713 void BrowsingDataRemover::OnClearedServerBoundCerts() { |
712 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 714 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
713 waiting_for_clear_server_bound_certs_ = false; | 715 waiting_for_clear_server_bound_certs_ = false; |
714 NotifyAndDeleteIfDone(); | 716 NotifyAndDeleteIfDone(); |
715 } | 717 } |
OLD | NEW |