| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_net_log.h" | 25 #include "chrome/browser/net/chrome_net_log.h" |
| 26 #include "chrome/browser/net/chrome_url_request_context.h" | 26 #include "chrome/browser/net/chrome_url_request_context.h" |
| 27 #include "chrome/browser/net/predictor.h" | 27 #include "chrome/browser/net/predictor.h" |
| 28 #include "chrome/browser/password_manager/password_store.h" | 28 #include "chrome/browser/password_manager/password_store.h" |
| 29 #include "chrome/browser/plugin_data_remover.h" | |
| 30 #include "chrome/browser/prefs/pref_member.h" | 29 #include "chrome/browser/prefs/pref_member.h" |
| 31 #include "chrome/browser/prerender/prerender_manager.h" | 30 #include "chrome/browser/prerender/prerender_manager.h" |
| 32 #include "chrome/browser/prerender/prerender_manager_factory.h" | 31 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 33 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 34 #include "chrome/browser/renderer_host/web_cache_manager.h" | 33 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 35 #include "chrome/browser/search_engines/template_url_service.h" | 34 #include "chrome/browser/search_engines/template_url_service.h" |
| 36 #include "chrome/browser/search_engines/template_url_service_factory.h" | 35 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 37 #include "chrome/browser/sessions/session_service.h" | 36 #include "chrome/browser/sessions/session_service.h" |
| 38 #include "chrome/browser/sessions/session_service_factory.h" | 37 #include "chrome/browser/sessions/session_service_factory.h" |
| 39 #include "chrome/browser/sessions/tab_restore_service.h" | 38 #include "chrome/browser/sessions/tab_restore_service.h" |
| 40 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 39 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 41 #include "chrome/browser/webdata/web_data_service.h" | 40 #include "chrome/browser/webdata/web_data_service.h" |
| 42 #include "chrome/common/chrome_notification_types.h" | 41 #include "chrome/common/chrome_notification_types.h" |
| 43 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
| 45 #include "content/browser/download/download_manager.h" | 44 #include "content/browser/download/download_manager.h" |
| 46 #include "content/browser/in_process_webkit/webkit_context.h" | 45 #include "content/browser/in_process_webkit/webkit_context.h" |
| 47 #include "content/browser/user_metrics.h" | 46 #include "content/browser/user_metrics.h" |
| 48 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
| 49 #include "content/public/browser/notification_source.h" | 48 #include "content/public/browser/notification_source.h" |
| 49 #include "content/public/browser/plugin_data_remover.h" |
| 50 #include "net/base/cookie_monster.h" | 50 #include "net/base/cookie_monster.h" |
| 51 #include "net/base/net_errors.h" | 51 #include "net/base/net_errors.h" |
| 52 #include "net/base/transport_security_state.h" | 52 #include "net/base/transport_security_state.h" |
| 53 #include "net/disk_cache/disk_cache.h" | 53 #include "net/disk_cache/disk_cache.h" |
| 54 #include "net/http/http_cache.h" | 54 #include "net/http/http_cache.h" |
| 55 #include "net/url_request/url_request_context.h" | 55 #include "net/url_request/url_request_context.h" |
| 56 #include "net/url_request/url_request_context_getter.h" | 56 #include "net/url_request/url_request_context_getter.h" |
| 57 #include "webkit/quota/quota_manager.h" | 57 #include "webkit/quota/quota_manager.h" |
| 58 #include "webkit/quota/quota_types.h" | 58 #include "webkit/quota/quota_types.h" |
| 59 | 59 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 BrowserThread::IO, FROM_HERE, | 229 BrowserThread::IO, FROM_HERE, |
| 230 base::Bind(&BrowsingDataRemover::ClearQuotaManagedDataOnIOThread, | 230 base::Bind(&BrowsingDataRemover::ClearQuotaManagedDataOnIOThread, |
| 231 base::Unretained(this))); | 231 base::Unretained(this))); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 if (remove_mask & REMOVE_LSO_DATA) { | 235 if (remove_mask & REMOVE_LSO_DATA) { |
| 236 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); | 236 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); |
| 237 | 237 |
| 238 waiting_for_clear_lso_data_ = true; | 238 waiting_for_clear_lso_data_ = true; |
| 239 if (!plugin_data_remover_.get()) | 239 if (!plugin_data_remover_.get()) { |
| 240 plugin_data_remover_ = new PluginDataRemover(profile_); | 240 plugin_data_remover_.reset( |
| 241 content::PluginDataRemover::Create(profile_->GetResourceContext())); |
| 242 } |
| 241 base::WaitableEvent* event = | 243 base::WaitableEvent* event = |
| 242 plugin_data_remover_->StartRemoving(delete_begin_); | 244 plugin_data_remover_->StartRemoving(delete_begin_); |
| 243 watcher_.StartWatching(event, this); | 245 watcher_.StartWatching(event, this); |
| 244 } | 246 } |
| 245 | 247 |
| 246 if (remove_mask & REMOVE_PASSWORDS) { | 248 if (remove_mask & REMOVE_PASSWORDS) { |
| 247 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 249 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
| 248 PasswordStore* password_store = | 250 PasswordStore* password_store = |
| 249 profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); | 251 profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); |
| 250 | 252 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 GetURLRequestContext()->cookie_store()->GetCookieMonster(); | 586 GetURLRequestContext()->cookie_store()->GetCookieMonster(); |
| 585 if (cookie_monster) { | 587 if (cookie_monster) { |
| 586 cookie_monster->DeleteAllCreatedBetweenAsync( | 588 cookie_monster->DeleteAllCreatedBetweenAsync( |
| 587 delete_begin_, delete_end_, | 589 delete_begin_, delete_end_, |
| 588 base::Bind(&BrowsingDataRemover::OnClearedCookies, | 590 base::Bind(&BrowsingDataRemover::OnClearedCookies, |
| 589 base::Unretained(this))); | 591 base::Unretained(this))); |
| 590 } else { | 592 } else { |
| 591 OnClearedCookies(0); | 593 OnClearedCookies(0); |
| 592 } | 594 } |
| 593 } | 595 } |
| OLD | NEW |