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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 base::WaitableEventWatcher::EventCallback watcher_callback = | 447 base::WaitableEventWatcher::EventCallback watcher_callback = |
448 base::Bind(&BrowsingDataRemover::OnWaitableEventSignaled, | 448 base::Bind(&BrowsingDataRemover::OnWaitableEventSignaled, |
449 base::Unretained(this)); | 449 base::Unretained(this)); |
450 watcher_.StartWatching(event, watcher_callback); | 450 watcher_.StartWatching(event, watcher_callback); |
451 } | 451 } |
452 #endif | 452 #endif |
453 | 453 |
454 if (remove_mask & REMOVE_PASSWORDS) { | 454 if (remove_mask & REMOVE_PASSWORDS) { |
455 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 455 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
456 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( | 456 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( |
457 profile_, Profile::EXPLICIT_ACCESS); | 457 profile_, Profile::EXPLICIT_ACCESS).get(); |
458 | 458 |
459 if (password_store) | 459 if (password_store) |
460 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); | 460 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); |
461 } | 461 } |
462 | 462 |
463 if (remove_mask & REMOVE_FORM_DATA) { | 463 if (remove_mask & REMOVE_FORM_DATA) { |
464 content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill")); | 464 content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill")); |
465 scoped_refptr<autofill::AutofillWebDataService> web_data_service = | 465 scoped_refptr<autofill::AutofillWebDataService> web_data_service = |
466 autofill::AutofillWebDataService::FromBrowserContext(profile_); | 466 autofill::AutofillWebDataService::FromBrowserContext(profile_); |
467 | 467 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 void BrowsingDataRemover::ClearLoggedInPredictor() { | 682 void BrowsingDataRemover::ClearLoggedInPredictor() { |
683 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 683 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
684 DCHECK(!waiting_for_clear_logged_in_predictor_); | 684 DCHECK(!waiting_for_clear_logged_in_predictor_); |
685 | 685 |
686 predictors::PredictorDatabase* predictor_db = | 686 predictors::PredictorDatabase* predictor_db = |
687 predictors::PredictorDatabaseFactory::GetForProfile(profile_); | 687 predictors::PredictorDatabaseFactory::GetForProfile(profile_); |
688 if (!predictor_db) | 688 if (!predictor_db) |
689 return; | 689 return; |
690 | 690 |
691 predictors::LoggedInPredictorTable* logged_in_table = | 691 predictors::LoggedInPredictorTable* logged_in_table = |
692 predictor_db->logged_in_table(); | 692 predictor_db->logged_in_table().get(); |
693 if (!logged_in_table) | 693 if (!logged_in_table) |
694 return; | 694 return; |
695 | 695 |
696 waiting_for_clear_logged_in_predictor_ = true; | 696 waiting_for_clear_logged_in_predictor_ = true; |
697 | 697 |
698 BrowserThread::PostTaskAndReply( | 698 BrowserThread::PostTaskAndReply( |
699 BrowserThread::DB, | 699 BrowserThread::DB, |
700 FROM_HERE, | 700 FROM_HERE, |
701 base::Bind(&predictors::LoggedInPredictorTable::DeleteAllCreatedBetween, | 701 base::Bind(&predictors::LoggedInPredictorTable::DeleteAllCreatedBetween, |
702 logged_in_table, | 702 logged_in_table, |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1093 waiting_for_clear_form_ = false; | 1093 waiting_for_clear_form_ = false; |
1094 NotifyAndDeleteIfDone(); | 1094 NotifyAndDeleteIfDone(); |
1095 } | 1095 } |
1096 | 1096 |
1097 void BrowsingDataRemover::OnClearedAutofillOriginURLs() { | 1097 void BrowsingDataRemover::OnClearedAutofillOriginURLs() { |
1098 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1098 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1099 waiting_for_clear_autofill_origin_urls_ = false; | 1099 waiting_for_clear_autofill_origin_urls_ = false; |
1100 NotifyAndDeleteIfDone(); | 1100 NotifyAndDeleteIfDone(); |
1101 } | 1101 } |
OLD | NEW |