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

Unified Diff: chrome/browser/password_manager/native_backend_kwallet_x.cc

Issue 347583004: PasswordStore refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/native_backend_kwallet_x.cc
diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc
index e493d0dc9abe8a5c0f170147027051881994750a..ca346cd0d66ebedc512ed0008f3bd2bf5c7407d1 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc
@@ -356,11 +356,12 @@ bool NativeBackendKWallet::RemoveLogin(const PasswordForm& form) {
return ok;
}
-bool NativeBackendKWallet::RemoveLoginsCreatedBetween(base::Time delete_begin,
- base::Time delete_end) {
- password_manager::PasswordStoreChangeList changes;
+bool NativeBackendKWallet::RemoveLoginsCreatedBetween(
+ base::Time delete_begin,
+ base::Time delete_end,
+ password_manager::PasswordStoreChangeList* changes) {
return RemoveLoginsBetween(
- delete_begin, delete_end, CREATION_TIMESTAMP, &changes);
+ delete_begin, delete_end, CREATION_TIMESTAMP, changes);
}
bool NativeBackendKWallet::RemoveLoginsSyncedBetween(
@@ -378,16 +379,6 @@ bool NativeBackendKWallet::GetLogins(const PasswordForm& form,
return GetLoginsList(forms, form.signon_realm, wallet_handle);
}
-bool NativeBackendKWallet::GetLoginsCreatedBetween(base::Time get_begin,
- base::Time get_end,
- PasswordFormList* forms) {
- int wallet_handle = WalletHandle();
- if (wallet_handle == kInvalidKWalletHandle)
- return false;
- return GetLoginsList(
- forms, get_begin, get_end, wallet_handle, CREATION_TIMESTAMP);
-}
-
bool NativeBackendKWallet::GetAutofillableLogins(PasswordFormList* forms) {
int wallet_handle = WalletHandle();
if (wallet_handle == kInvalidKWalletHandle)
@@ -493,33 +484,6 @@ bool NativeBackendKWallet::GetLoginsList(PasswordFormList* forms,
return true;
}
-bool NativeBackendKWallet::GetLoginsList(PasswordFormList* forms,
- const base::Time& begin,
- const base::Time& end,
- int wallet_handle,
- TimestampToCompare date_to_compare) {
- PasswordFormList all_forms;
- if (!GetAllLogins(&all_forms, wallet_handle))
- return false;
-
- // We have to read all the entries, and then filter them here.
- base::Time autofill::PasswordForm::*date_member =
- date_to_compare == CREATION_TIMESTAMP
- ? &autofill::PasswordForm::date_created
- : &autofill::PasswordForm::date_synced;
- forms->reserve(forms->size() + all_forms.size());
- for (size_t i = 0; i < all_forms.size(); ++i) {
- if (begin <= all_forms[i]->*date_member &&
- (end.is_null() || all_forms[i]->*date_member < end)) {
- forms->push_back(all_forms[i]);
- } else {
- delete all_forms[i];
- }
- }
-
- return true;
-}
-
bool NativeBackendKWallet::GetAllLogins(PasswordFormList* forms,
int wallet_handle) {
// We could probably also use readEntryList here.

Powered by Google App Engine
This is Rietveld 408576698