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 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); | 488 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); |
489 | 489 |
490 storage_partition_remove_mask |= | 490 storage_partition_remove_mask |= |
491 content::StoragePartition::REMOVE_DATA_MASK_COOKIES; | 491 content::StoragePartition::REMOVE_DATA_MASK_COOKIES; |
492 | 492 |
493 // Clear the safebrowsing cookies only if time period is for "all time". It | 493 // Clear the safebrowsing cookies only if time period is for "all time". It |
494 // doesn't make sense to apply the time period of deleting in the last X | 494 // doesn't make sense to apply the time period of deleting in the last X |
495 // hours/days to the safebrowsing cookies since they aren't the result of | 495 // hours/days to the safebrowsing cookies since they aren't the result of |
496 // any user action. | 496 // any user action. |
497 if (delete_begin_ == base::Time()) { | 497 if (delete_begin_ == base::Time()) { |
498 SafeBrowsingService* sb_service = | 498 safe_browsing::SafeBrowsingService* sb_service = |
499 g_browser_process->safe_browsing_service(); | 499 g_browser_process->safe_browsing_service(); |
500 if (sb_service) { | 500 if (sb_service) { |
501 net::URLRequestContextGetter* sb_context = | 501 net::URLRequestContextGetter* sb_context = |
502 sb_service->url_request_context(); | 502 sb_service->url_request_context(); |
503 ++waiting_for_clear_cookies_count_; | 503 ++waiting_for_clear_cookies_count_; |
504 BrowserThread::PostTask( | 504 BrowserThread::PostTask( |
505 BrowserThread::IO, FROM_HERE, | 505 BrowserThread::IO, FROM_HERE, |
506 base::Bind(&BrowsingDataRemover::ClearCookiesOnIOThread, | 506 base::Bind(&BrowsingDataRemover::ClearCookiesOnIOThread, |
507 base::Unretained(this), base::Unretained(sb_context))); | 507 base::Unretained(this), base::Unretained(sb_context))); |
508 } | 508 } |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 waiting_for_clear_domain_reliability_monitor_ = false; | 1194 waiting_for_clear_domain_reliability_monitor_ = false; |
1195 NotifyAndDeleteIfDone(); | 1195 NotifyAndDeleteIfDone(); |
1196 } | 1196 } |
1197 | 1197 |
1198 // static | 1198 // static |
1199 BrowsingDataRemover::CallbackSubscription | 1199 BrowsingDataRemover::CallbackSubscription |
1200 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1200 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
1201 const BrowsingDataRemover::Callback& callback) { | 1201 const BrowsingDataRemover::Callback& callback) { |
1202 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1202 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
1203 } | 1203 } |
OLD | NEW |