| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.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/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
| 21 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 21 #include "chrome/browser/domain_reliability/service_factory.h" | 22 #include "chrome/browser/domain_reliability/service_factory.h" |
| 22 #include "chrome/browser/download/download_prefs.h" | 23 #include "chrome/browser/download/download_prefs.h" |
| 23 #include "chrome/browser/download/download_service_factory.h" | 24 #include "chrome/browser/download/download_service_factory.h" |
| 24 #include "chrome/browser/history/history_service_factory.h" | 25 #include "chrome/browser/history/history_service_factory.h" |
| 25 #include "chrome/browser/history/web_history_service_factory.h" | 26 #include "chrome/browser/history/web_history_service_factory.h" |
| 26 #include "chrome/browser/io_thread.h" | 27 #include "chrome/browser/io_thread.h" |
| 27 #include "chrome/browser/media/media_device_id_salt.h" | 28 #include "chrome/browser/media/media_device_id_salt.h" |
| 28 #include "chrome/browser/net/predictor.h" | 29 #include "chrome/browser/net/predictor.h" |
| 29 #include "chrome/browser/password_manager/password_store_factory.h" | 30 #include "chrome/browser/password_manager/password_store_factory.h" |
| 30 #include "chrome/browser/prerender/prerender_manager.h" | 31 #include "chrome/browser/prerender/prerender_manager.h" |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 plugin_data_remover_->StartRemoving(delete_begin_); | 553 plugin_data_remover_->StartRemoving(delete_begin_); |
| 553 | 554 |
| 554 base::WaitableEventWatcher::EventCallback watcher_callback = | 555 base::WaitableEventWatcher::EventCallback watcher_callback = |
| 555 base::Bind(&BrowsingDataRemover::OnWaitableEventSignaled, | 556 base::Bind(&BrowsingDataRemover::OnWaitableEventSignaled, |
| 556 base::Unretained(this)); | 557 base::Unretained(this)); |
| 557 watcher_.StartWatching(event, watcher_callback); | 558 watcher_.StartWatching(event, watcher_callback); |
| 558 } | 559 } |
| 559 #endif | 560 #endif |
| 560 | 561 |
| 561 if (remove_mask & REMOVE_SITE_USAGE_DATA || remove_mask & REMOVE_HISTORY) { | 562 if (remove_mask & REMOVE_SITE_USAGE_DATA || remove_mask & REMOVE_HISTORY) { |
| 562 profile_->GetHostContentSettingsMap()->ClearSettingsForOneType( | 563 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 563 CONTENT_SETTINGS_TYPE_APP_BANNER); | 564 ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_APP_BANNER); |
| 564 profile_->GetHostContentSettingsMap()->ClearSettingsForOneType( | 565 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 565 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT); | 566 ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT); |
| 566 } | 567 } |
| 567 | 568 |
| 568 if (remove_mask & REMOVE_PASSWORDS) { | 569 if (remove_mask & REMOVE_PASSWORDS) { |
| 569 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 570 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
| 570 password_manager::PasswordStore* password_store = | 571 password_manager::PasswordStore* password_store = |
| 571 PasswordStoreFactory::GetForProfile( | 572 PasswordStoreFactory::GetForProfile( |
| 572 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); | 573 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 573 | 574 |
| 574 if (password_store) { | 575 if (password_store) { |
| 575 waiting_for_clear_passwords_ = true; | 576 waiting_for_clear_passwords_ = true; |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 waiting_for_clear_domain_reliability_monitor_ = false; | 1157 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1157 NotifyAndDeleteIfDone(); | 1158 NotifyAndDeleteIfDone(); |
| 1158 } | 1159 } |
| 1159 | 1160 |
| 1160 // static | 1161 // static |
| 1161 BrowsingDataRemover::CallbackSubscription | 1162 BrowsingDataRemover::CallbackSubscription |
| 1162 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1163 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
| 1163 const BrowsingDataRemover::Callback& callback) { | 1164 const BrowsingDataRemover::Callback& callback) { |
| 1164 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1165 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
| 1165 } | 1166 } |
| OLD | NEW |