| 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" |
| 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/download/download_service.h" | 19 #include "chrome/browser/download/download_service.h" |
| 20 #include "chrome/browser/download/download_service_factory.h" | 20 #include "chrome/browser/download/download_service_factory.h" |
| 21 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
| 22 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 22 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 23 #include "chrome/browser/history/history.h" | 23 #include "chrome/browser/history/history.h" |
| 24 #include "chrome/browser/io_thread.h" | 24 #include "chrome/browser/io_thread.h" |
| 25 #include "chrome/browser/net/chrome_url_request_context.h" | 25 #include "chrome/browser/net/chrome_url_request_context.h" |
| 26 #include "chrome/browser/net/predictor.h" | 26 #include "chrome/browser/net/predictor.h" |
| 27 #include "chrome/browser/password_manager/password_store.h" | 27 #include "chrome/browser/password_manager/password_store.h" |
| 28 #include "chrome/browser/password_manager/password_store_factory.h" |
| 28 #include "chrome/browser/prefs/pref_member.h" | 29 #include "chrome/browser/prefs/pref_member.h" |
| 29 #include "chrome/browser/prerender/prerender_manager.h" | 30 #include "chrome/browser/prerender/prerender_manager.h" |
| 30 #include "chrome/browser/prerender/prerender_manager_factory.h" | 31 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/renderer_host/web_cache_manager.h" | 33 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 34 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 34 #include "chrome/browser/search_engines/template_url_service.h" | 35 #include "chrome/browser/search_engines/template_url_service.h" |
| 35 #include "chrome/browser/search_engines/template_url_service_factory.h" | 36 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 36 #include "chrome/browser/sessions/session_service.h" | 37 #include "chrome/browser/sessions/session_service.h" |
| 37 #include "chrome/browser/sessions/session_service_factory.h" | 38 #include "chrome/browser/sessions/session_service_factory.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 plugin_data_remover_.reset( | 330 plugin_data_remover_.reset( |
| 330 content::PluginDataRemover::Create(profile_->GetResourceContext())); | 331 content::PluginDataRemover::Create(profile_->GetResourceContext())); |
| 331 } | 332 } |
| 332 base::WaitableEvent* event = | 333 base::WaitableEvent* event = |
| 333 plugin_data_remover_->StartRemoving(delete_begin_); | 334 plugin_data_remover_->StartRemoving(delete_begin_); |
| 334 watcher_.StartWatching(event, this); | 335 watcher_.StartWatching(event, this); |
| 335 } | 336 } |
| 336 | 337 |
| 337 if (remove_mask & REMOVE_PASSWORDS) { | 338 if (remove_mask & REMOVE_PASSWORDS) { |
| 338 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 339 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
| 339 PasswordStore* password_store = | 340 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( |
| 340 profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); | 341 profile_, Profile::EXPLICIT_ACCESS); |
| 341 | 342 |
| 342 if (password_store) | 343 if (password_store) |
| 343 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); | 344 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); |
| 344 } | 345 } |
| 345 | 346 |
| 346 if (remove_mask & REMOVE_FORM_DATA) { | 347 if (remove_mask & REMOVE_FORM_DATA) { |
| 347 content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill")); | 348 content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill")); |
| 348 WebDataService* web_data_service = | 349 WebDataService* web_data_service = |
| 349 profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); | 350 profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); |
| 350 | 351 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 BrowserThread::UI, FROM_HERE, | 713 BrowserThread::UI, FROM_HERE, |
| 713 base::Bind(&BrowsingDataRemover::OnClearedOriginBoundCerts, | 714 base::Bind(&BrowsingDataRemover::OnClearedOriginBoundCerts, |
| 714 base::Unretained(this))); | 715 base::Unretained(this))); |
| 715 } | 716 } |
| 716 | 717 |
| 717 void BrowsingDataRemover::OnClearedOriginBoundCerts() { | 718 void BrowsingDataRemover::OnClearedOriginBoundCerts() { |
| 718 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 719 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 719 waiting_for_clear_origin_bound_certs_ = false; | 720 waiting_for_clear_origin_bound_certs_ = false; |
| 720 NotifyAndDeleteIfDone(); | 721 NotifyAndDeleteIfDone(); |
| 721 } | 722 } |
| OLD | NEW |