Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Side by Side Diff: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc

Issue 2616633002: Respect time range in browsing data removal for last-visited data. (Closed)
Patch Set: added URL filtering and tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/history/history_service_factory.h" 20 #include "chrome/browser/history/history_service_factory.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 290
287 // Currently, ContentSuggestionService instance exists only on Android. 291 // Currently, ContentSuggestionService instance exists only on Android.
288 ntp_snippets::ContentSuggestionsService* content_suggestions_service = 292 ntp_snippets::ContentSuggestionsService* content_suggestions_service =
289 ContentSuggestionsServiceFactory::GetForProfileIfExists(profile_); 293 ContentSuggestionsServiceFactory::GetForProfileIfExists(profile_);
290 if (content_suggestions_service) { 294 if (content_suggestions_service) {
291 content_suggestions_service->ClearHistory(delete_begin_, delete_end_, 295 content_suggestions_service->ClearHistory(delete_begin_, delete_end_,
292 filter); 296 filter);
293 } 297 }
294 298
295 // Remove the last visit dates meta-data from the bookmark model. 299 // Remove the last visit dates meta-data from the bookmark model.
296 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the
297 // time range and the filter.
298 bookmarks::BookmarkModel* bookmark_model = 300 bookmarks::BookmarkModel* bookmark_model =
299 BookmarkModelFactory::GetForBrowserContext(profile_); 301 BookmarkModelFactory::GetForBrowserContext(profile_);
300 if (bookmark_model) 302 if (bookmark_model) {
301 ntp_snippets::RemoveAllLastVisitDates(bookmark_model); 303 ntp_snippets::RemoveLastVisitedDatesBetween(delete_begin_, delete_end_,
304 filter, bookmark_model);
305 }
302 306
303 #if BUILDFLAG(ENABLE_EXTENSIONS) 307 #if BUILDFLAG(ENABLE_EXTENSIONS)
304 // The extension activity log contains details of which websites extensions 308 // The extension activity log contains details of which websites extensions
305 // were active on. It therefore indirectly stores details of websites a 309 // were active on. It therefore indirectly stores details of websites a
306 // user has visited so best clean from here as well. 310 // user has visited so best clean from here as well.
307 // TODO(msramek): Support all backends with filter (crbug.com/589586). 311 // TODO(msramek): Support all backends with filter (crbug.com/589586).
308 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs( 312 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(
309 std::set<GURL>()); 313 std::set<GURL>());
310 314
311 // Clear launch times as they are a form of history. 315 // Clear launch times as they are a form of history.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 851
848 #if defined(OS_CHROMEOS) 852 #if defined(OS_CHROMEOS)
849 void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys( 853 void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys(
850 chromeos::DBusMethodCallStatus call_status, 854 chromeos::DBusMethodCallStatus call_status,
851 bool result) { 855 bool result) {
852 LOG_IF(ERROR, call_status != chromeos::DBUS_METHOD_CALL_SUCCESS || !result) 856 LOG_IF(ERROR, call_status != chromeos::DBUS_METHOD_CALL_SUCCESS || !result)
853 << "Failed to clear platform keys."; 857 << "Failed to clear platform keys.";
854 clear_platform_keys_.GetCompletionCallback().Run(); 858 clear_platform_keys_.GetCompletionCallback().Run();
855 } 859 }
856 #endif 860 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698