| 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/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/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" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "chrome/browser/autofill/personal_data_manager.h" | 16 #include "chrome/browser/autofill/personal_data_manager.h" |
| 17 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 17 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 20 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 20 #include "chrome/browser/download/download_service.h" | 21 #include "chrome/browser/download/download_service.h" |
| 21 #include "chrome/browser/download/download_service_factory.h" | 22 #include "chrome/browser/download/download_service_factory.h" |
| 22 #include "chrome/browser/extensions/extension_service.h" | 23 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 24 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 24 #include "chrome/browser/history/history.h" | 25 #include "chrome/browser/history/history.h" |
| 25 #include "chrome/browser/history/history_service_factory.h" | 26 #include "chrome/browser/history/history_service_factory.h" |
| 26 #include "chrome/browser/io_thread.h" | 27 #include "chrome/browser/io_thread.h" |
| 27 #include "chrome/browser/nacl_host/nacl_browser.h" | 28 #include "chrome/browser/nacl_host/nacl_browser.h" |
| 28 #include "chrome/browser/net/chrome_url_request_context.h" | 29 #include "chrome/browser/net/chrome_url_request_context.h" |
| 29 #include "chrome/browser/net/predictor.h" | 30 #include "chrome/browser/net/predictor.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 session_service->DeleteLastSession(); | 289 session_service->DeleteLastSession(); |
| 289 #endif | 290 #endif |
| 290 } | 291 } |
| 291 } | 292 } |
| 292 | 293 |
| 293 if (remove_mask & REMOVE_DOWNLOADS) { | 294 if (remove_mask & REMOVE_DOWNLOADS) { |
| 294 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); | 295 content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); |
| 295 DownloadManager* download_manager = | 296 DownloadManager* download_manager = |
| 296 BrowserContext::GetDownloadManager(profile_); | 297 BrowserContext::GetDownloadManager(profile_); |
| 297 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); | 298 download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); |
| 298 download_manager->ClearLastDownloadPath(); | 299 DownloadService* download_service = |
| 300 DownloadServiceFactory::GetForProfile(profile_); |
| 301 ChromeDownloadManagerDelegate* download_manager_delegate = |
| 302 download_service->GetDownloadManagerDelegate(); |
| 303 download_manager_delegate->ClearLastDownloadPath(); |
| 299 } | 304 } |
| 300 | 305 |
| 301 // We ignore the REMOVE_COOKIES request if UNPROTECTED_WEB is not set, | 306 // We ignore the REMOVE_COOKIES request if UNPROTECTED_WEB is not set, |
| 302 // so that callers who request REMOVE_SITE_DATA with PROTECTED_WEB | 307 // so that callers who request REMOVE_SITE_DATA with PROTECTED_WEB |
| 303 // don't accidentally remove the cookies that are associated with the | 308 // don't accidentally remove the cookies that are associated with the |
| 304 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated | 309 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated |
| 305 // between UNPROTECTED_WEB and PROTECTED_WEB. | 310 // between UNPROTECTED_WEB and PROTECTED_WEB. |
| 306 if (remove_mask & REMOVE_COOKIES && | 311 if (remove_mask & REMOVE_COOKIES && |
| 307 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { | 312 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { |
| 308 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); | 313 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 BrowserThread::UI, FROM_HERE, | 883 BrowserThread::UI, FROM_HERE, |
| 879 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, | 884 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, |
| 880 base::Unretained(this))); | 885 base::Unretained(this))); |
| 881 } | 886 } |
| 882 | 887 |
| 883 void BrowsingDataRemover::OnClearedServerBoundCerts() { | 888 void BrowsingDataRemover::OnClearedServerBoundCerts() { |
| 884 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 889 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 885 waiting_for_clear_server_bound_certs_ = false; | 890 waiting_for_clear_server_bound_certs_ = false; |
| 886 NotifyAndDeleteIfDone(); | 891 NotifyAndDeleteIfDone(); |
| 887 } | 892 } |
| OLD | NEW |