| 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 <set> |
| 8 #include <string> |
| 9 #include <utility> |
| 10 |
| 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 11 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 9 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" | 14 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" |
| 11 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 15 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 12 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 16 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 15 #include "chrome/browser/domain_reliability/service_factory.h" | 19 #include "chrome/browser/domain_reliability/service_factory.h" |
| 16 #include "chrome/browser/download/download_prefs.h" | 20 #include "chrome/browser/download/download_prefs.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 291 |
| 288 // Currently, ContentSuggestionService instance exists only on Android. | 292 // Currently, ContentSuggestionService instance exists only on Android. |
| 289 ntp_snippets::ContentSuggestionsService* content_suggestions_service = | 293 ntp_snippets::ContentSuggestionsService* content_suggestions_service = |
| 290 ContentSuggestionsServiceFactory::GetForProfileIfExists(profile_); | 294 ContentSuggestionsServiceFactory::GetForProfileIfExists(profile_); |
| 291 if (content_suggestions_service) { | 295 if (content_suggestions_service) { |
| 292 content_suggestions_service->ClearHistory(delete_begin_, delete_end_, | 296 content_suggestions_service->ClearHistory(delete_begin_, delete_end_, |
| 293 filter); | 297 filter); |
| 294 } | 298 } |
| 295 | 299 |
| 296 // Remove the last visit dates meta-data from the bookmark model. | 300 // Remove the last visit dates meta-data from the bookmark model. |
| 297 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the | |
| 298 // time range and the filter. | |
| 299 bookmarks::BookmarkModel* bookmark_model = | 301 bookmarks::BookmarkModel* bookmark_model = |
| 300 BookmarkModelFactory::GetForBrowserContext(profile_); | 302 BookmarkModelFactory::GetForBrowserContext(profile_); |
| 301 if (bookmark_model) | 303 if (bookmark_model) { |
| 302 ntp_snippets::RemoveAllLastVisitDates(bookmark_model); | 304 ntp_snippets::RemoveLastVisitedDatesBetween(delete_begin_, delete_end_, |
| 305 filter, bookmark_model); |
| 306 } |
| 303 | 307 |
| 304 #if BUILDFLAG(ENABLE_EXTENSIONS) | 308 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 305 // The extension activity log contains details of which websites extensions | 309 // The extension activity log contains details of which websites extensions |
| 306 // were active on. It therefore indirectly stores details of websites a | 310 // were active on. It therefore indirectly stores details of websites a |
| 307 // user has visited so best clean from here as well. | 311 // user has visited so best clean from here as well. |
| 308 // TODO(msramek): Support all backends with filter (crbug.com/589586). | 312 // TODO(msramek): Support all backends with filter (crbug.com/589586). |
| 309 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs( | 313 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs( |
| 310 std::set<GURL>()); | 314 std::set<GURL>()); |
| 311 | 315 |
| 312 // Clear launch times as they are a form of history. | 316 // Clear launch times as they are a form of history. |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 | 861 |
| 858 #if defined(OS_CHROMEOS) | 862 #if defined(OS_CHROMEOS) |
| 859 void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys( | 863 void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys( |
| 860 chromeos::DBusMethodCallStatus call_status, | 864 chromeos::DBusMethodCallStatus call_status, |
| 861 bool result) { | 865 bool result) { |
| 862 LOG_IF(ERROR, call_status != chromeos::DBUS_METHOD_CALL_SUCCESS || !result) | 866 LOG_IF(ERROR, call_status != chromeos::DBUS_METHOD_CALL_SUCCESS || !result) |
| 863 << "Failed to clear platform keys."; | 867 << "Failed to clear platform keys."; |
| 864 clear_platform_keys_.GetCompletionCallback().Run(); | 868 clear_platform_keys_.GetCompletionCallback().Run(); |
| 865 } | 869 } |
| 866 #endif | 870 #endif |
| OLD | NEW |