| 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/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
| 16 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 16 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 18 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/download/download_prefs.h" | 20 #include "chrome/browser/download/download_prefs.h" |
| 21 #include "chrome/browser/download/download_service_factory.h" | 21 #include "chrome/browser/download/download_service_factory.h" |
| 22 #include "chrome/browser/extensions/activity_log/activity_log.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_service.h" | 25 #include "chrome/browser/history/history_service.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/nacl_host/pnacl_host.h" | 29 #include "chrome/browser/nacl_host/pnacl_host.h" |
| 29 #include "chrome/browser/net/chrome_url_request_context.h" | 30 #include "chrome/browser/net/chrome_url_request_context.h" |
| 30 #include "chrome/browser/net/predictor.h" | 31 #include "chrome/browser/net/predictor.h" |
| 31 #include "chrome/browser/password_manager/password_store.h" | 32 #include "chrome/browser/password_manager/password_store.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 if (!remove_origin_.is_empty()) | 264 if (!remove_origin_.is_empty()) |
| 264 restrict_urls.insert(remove_origin_); | 265 restrict_urls.insert(remove_origin_); |
| 265 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); | 266 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); |
| 266 waiting_for_clear_history_ = true; | 267 waiting_for_clear_history_ = true; |
| 267 | 268 |
| 268 history_service->ExpireLocalAndRemoteHistoryBetween( | 269 history_service->ExpireLocalAndRemoteHistoryBetween( |
| 269 restrict_urls, delete_begin_, delete_end_, | 270 restrict_urls, delete_begin_, delete_end_, |
| 270 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, | 271 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, |
| 271 base::Unretained(this)), | 272 base::Unretained(this)), |
| 272 &history_task_tracker_); | 273 &history_task_tracker_); |
| 274 |
| 275 // The extension activity contains details of which websites extensions |
| 276 // were active on. It therefore indirectly stores details of websites a |
| 277 // user has visited so best clean from here as well. |
| 278 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls); |
| 273 } | 279 } |
| 274 | 280 |
| 275 // Need to clear the host cache and accumulated speculative data, as it also | 281 // Need to clear the host cache and accumulated speculative data, as it also |
| 276 // reveals some history: we have no mechanism to track when these items were | 282 // reveals some history: we have no mechanism to track when these items were |
| 277 // created, so we'll clear them all. Better safe than sorry. | 283 // created, so we'll clear them all. Better safe than sorry. |
| 278 if (g_browser_process->io_thread()) { | 284 if (g_browser_process->io_thread()) { |
| 279 waiting_for_clear_hostname_resolution_cache_ = true; | 285 waiting_for_clear_hostname_resolution_cache_ = true; |
| 280 BrowserThread::PostTask( | 286 BrowserThread::PostTask( |
| 281 BrowserThread::IO, FROM_HERE, | 287 BrowserThread::IO, FROM_HERE, |
| 282 base::Bind( | 288 base::Bind( |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1169 waiting_for_clear_autofill_origin_urls_ = false; | 1175 waiting_for_clear_autofill_origin_urls_ = false; |
| 1170 NotifyAndDeleteIfDone(); | 1176 NotifyAndDeleteIfDone(); |
| 1171 } | 1177 } |
| 1172 | 1178 |
| 1173 void BrowsingDataRemover::OnClearWebRTCIdentityStore() { | 1179 void BrowsingDataRemover::OnClearWebRTCIdentityStore() { |
| 1174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1180 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1175 waiting_for_clear_webrtc_identity_store_ = false; | 1181 waiting_for_clear_webrtc_identity_store_ = false; |
| 1176 NotifyAndDeleteIfDone(); | 1182 NotifyAndDeleteIfDone(); |
| 1177 } | 1183 } |
| OLD | NEW |