OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chrome_browsing_data_remover_delegate.h" | 5 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
6 | 6 |
7 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" | 10 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" |
11 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 11 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
12 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 12 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 14 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
15 #include "chrome/browser/domain_reliability/service_factory.h" | 15 #include "chrome/browser/domain_reliability/service_factory.h" |
| 16 #include "chrome/browser/download/download_prefs.h" |
16 #include "chrome/browser/history/history_service_factory.h" | 17 #include "chrome/browser/history/history_service_factory.h" |
17 #include "chrome/browser/history/web_history_service_factory.h" | 18 #include "chrome/browser/history/web_history_service_factory.h" |
18 #include "chrome/browser/io_thread.h" | 19 #include "chrome/browser/io_thread.h" |
19 #include "chrome/browser/media/media_device_id_salt.h" | 20 #include "chrome/browser/media/media_device_id_salt.h" |
20 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h" | 21 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h" |
21 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h" | 22 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h" |
22 #include "chrome/browser/net/predictor.h" | 23 #include "chrome/browser/net/predictor.h" |
23 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 24 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
24 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 25 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
25 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" | 26 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 // |previews_service| is null if |profile_| is off the record. | 469 // |previews_service| is null if |profile_| is off the record. |
469 PreviewsService* previews_service = | 470 PreviewsService* previews_service = |
470 PreviewsServiceFactory::GetForProfile(profile_); | 471 PreviewsServiceFactory::GetForProfile(profile_); |
471 if (previews_service && previews_service->previews_ui_service()) { | 472 if (previews_service && previews_service->previews_ui_service()) { |
472 previews_service->previews_ui_service()->ClearBlackList(delete_begin_, | 473 previews_service->previews_ui_service()->ClearBlackList(delete_begin_, |
473 delete_end_); | 474 delete_end_); |
474 } | 475 } |
475 } | 476 } |
476 | 477 |
477 ////////////////////////////////////////////////////////////////////////////// | 478 ////////////////////////////////////////////////////////////////////////////// |
| 479 // REMOVE_DOWNLOADS |
| 480 if ((remove_mask & BrowsingDataRemover::REMOVE_DOWNLOADS) && |
| 481 may_delete_history) { |
| 482 DownloadPrefs* download_prefs = DownloadPrefs::FromDownloadManager( |
| 483 BrowserContext::GetDownloadManager(profile_)); |
| 484 download_prefs->SetSaveFilePath(download_prefs->DownloadPath()); |
| 485 } |
| 486 |
| 487 ////////////////////////////////////////////////////////////////////////////// |
478 // REMOVE_COOKIES | 488 // REMOVE_COOKIES |
479 // We ignore the REMOVE_COOKIES request if UNPROTECTED_WEB is not set, | 489 // We ignore the REMOVE_COOKIES request if UNPROTECTED_WEB is not set, |
480 // so that callers who request REMOVE_SITE_DATA with PROTECTED_WEB | 490 // so that callers who request REMOVE_SITE_DATA with PROTECTED_WEB |
481 // don't accidentally remove the cookies that are associated with the | 491 // don't accidentally remove the cookies that are associated with the |
482 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated | 492 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated |
483 // between UNPROTECTED_WEB and PROTECTED_WEB. | 493 // between UNPROTECTED_WEB and PROTECTED_WEB. |
484 if (remove_mask & BrowsingDataRemover::REMOVE_COOKIES && | 494 if (remove_mask & BrowsingDataRemover::REMOVE_COOKIES && |
485 origin_type_mask & BrowsingDataHelper::UNPROTECTED_WEB) { | 495 origin_type_mask & BrowsingDataHelper::UNPROTECTED_WEB) { |
486 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); | 496 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); |
487 | 497 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 | 857 |
848 #if defined(OS_CHROMEOS) | 858 #if defined(OS_CHROMEOS) |
849 void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys( | 859 void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys( |
850 chromeos::DBusMethodCallStatus call_status, | 860 chromeos::DBusMethodCallStatus call_status, |
851 bool result) { | 861 bool result) { |
852 LOG_IF(ERROR, call_status != chromeos::DBUS_METHOD_CALL_SUCCESS || !result) | 862 LOG_IF(ERROR, call_status != chromeos::DBUS_METHOD_CALL_SUCCESS || !result) |
853 << "Failed to clear platform keys."; | 863 << "Failed to clear platform keys."; |
854 clear_platform_keys_.GetCompletionCallback().Run(); | 864 clear_platform_keys_.GetCompletionCallback().Run(); |
855 } | 865 } |
856 #endif | 866 #endif |
OLD | NEW |