Chromium Code Reviews| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 691 } | 691 } |
| 692 | 692 |
| 693 if (remove_mask & REMOVE_PASSWORDS) { | 693 if (remove_mask & REMOVE_PASSWORDS) { |
| 694 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); | 694 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); |
| 695 password_manager::PasswordStore* password_store = | 695 password_manager::PasswordStore* password_store = |
| 696 PasswordStoreFactory::GetForProfile( | 696 PasswordStoreFactory::GetForProfile( |
| 697 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); | 697 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 698 | 698 |
| 699 if (password_store) { | 699 if (password_store) { |
| 700 waiting_for_clear_passwords_ = true; | 700 waiting_for_clear_passwords_ = true; |
| 701 password_store->RemoveLoginsCreatedBetween( | 701 auto on_cleared_passwords = |
| 702 delete_begin_, delete_end_, | |
| 703 base::Bind(&BrowsingDataRemover::OnClearedPasswords, | 702 base::Bind(&BrowsingDataRemover::OnClearedPasswords, |
| 704 weak_ptr_factory_.GetWeakPtr())); | 703 weak_ptr_factory_.GetWeakPtr()); |
| 704 if (remove_origin.unique()) | |
|
Mike West
2016/02/04 18:25:11
Why "unique"? What if I pass in a `data:` URL, for
Timo Reimann
2016/02/05 01:12:38
The "unique" check was meant as a temporary soluti
| |
| 705 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_, | |
| 706 on_cleared_passwords); | |
| 707 else | |
|
Mike West
2016/02/04 18:25:11
Nit: Ditto.
Timo Reimann
2016/02/05 01:12:38
Done.
| |
| 708 password_store->RemoveLoginsByOriginAndTime( | |
| 709 remove_origin, delete_begin_, delete_end_, on_cleared_passwords); | |
| 705 } | 710 } |
| 706 } | 711 } |
| 707 | 712 |
| 708 if (remove_mask & REMOVE_HISTORY) { | 713 if (remove_mask & REMOVE_HISTORY) { |
| 709 password_manager::PasswordStore* password_store = | 714 password_manager::PasswordStore* password_store = |
| 710 PasswordStoreFactory::GetForProfile( | 715 PasswordStoreFactory::GetForProfile( |
| 711 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); | 716 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 712 | 717 |
| 713 if (password_store) { | 718 if (password_store) { |
| 714 waiting_for_clear_passwords_stats_ = true; | 719 waiting_for_clear_passwords_stats_ = true; |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1188 waiting_for_clear_domain_reliability_monitor_ = false; | 1193 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1189 NotifyIfDone(); | 1194 NotifyIfDone(); |
| 1190 } | 1195 } |
| 1191 | 1196 |
| 1192 // static | 1197 // static |
| 1193 BrowsingDataRemover::CallbackSubscription | 1198 BrowsingDataRemover::CallbackSubscription |
| 1194 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1199 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
| 1195 const BrowsingDataRemover::Callback& callback) { | 1200 const BrowsingDataRemover::Callback& callback) { |
| 1196 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1201 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
| 1197 } | 1202 } |
| OLD | NEW |