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

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

Issue 986983002: Delete PasswordStoreX::Get*LoginsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebased Created 5 years, 9 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
« no previous file with comments | « chrome/browser/password_manager/password_store_x.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_store_x.cc
diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc
index 595770f599d5d222c47aca3eed0661fdd58341bf..71694ad4a5df47528f17f6d728cfffcdff9b8e93 100644
--- a/chrome/browser/password_manager/password_store_x.cc
+++ b/chrome/browser/password_manager/password_store_x.cc
@@ -122,19 +122,20 @@ PasswordStoreChangeList PasswordStoreX::RemoveLoginsSyncedBetweenImpl(
}
namespace {
+
struct LoginLessThan {
bool operator()(const PasswordForm* a, const PasswordForm* b) {
return a->origin < b->origin;
}
};
-} // anonymous namespace
-void PasswordStoreX::SortLoginsByOrigin(
- std::vector<autofill::PasswordForm*>* list) {
- // In login_database.cc, the query has ORDER BY origin_url. Simulate that.
+// Sorts |list| by origin, like the ORDER BY clause in login_database.cc.
+void SortLoginsByOrigin(std::vector<autofill::PasswordForm*>* list) {
std::sort(list->begin(), list->end(), LoginLessThan());
}
+} // anonymous namespace
+
ScopedVector<autofill::PasswordForm> PasswordStoreX::FillMatchingLogins(
const autofill::PasswordForm& form,
AuthorizationPromptPolicy prompt_policy) {
@@ -154,51 +155,13 @@ ScopedVector<autofill::PasswordForm> PasswordStoreX::FillMatchingLogins(
return matched_forms.Pass();
}
-void PasswordStoreX::GetAutofillableLoginsImpl(
- scoped_ptr<PasswordStore::GetLoginsRequest> request) {
- CheckMigration();
- ScopedVector<autofill::PasswordForm> obtained_forms;
- if (use_native_backend() &&
- backend_->GetAutofillableLogins(&obtained_forms)) {
- SortLoginsByOrigin(&obtained_forms.get());
- // See GetLoginsImpl() for why we disallow fallback conditionally here.
- if (!obtained_forms.empty())
- allow_fallback_ = false;
- request->NotifyConsumerWithResults(obtained_forms.Pass());
- return;
- } else if (allow_default_store()) {
- PasswordStoreDefault::GetAutofillableLoginsImpl(request.Pass());
- return;
- }
- // The consumer will be left hanging unless we reply.
- request->NotifyConsumerWithResults(ScopedVector<autofill::PasswordForm>());
-}
-
-void PasswordStoreX::GetBlacklistLoginsImpl(
- scoped_ptr<PasswordStore::GetLoginsRequest> request) {
- CheckMigration();
- ScopedVector<autofill::PasswordForm> obtained_forms;
- if (use_native_backend() && backend_->GetBlacklistLogins(&obtained_forms)) {
- SortLoginsByOrigin(&obtained_forms.get());
- // See GetLoginsImpl() for why we disallow fallback conditionally here.
- if (!obtained_forms.empty())
- allow_fallback_ = false;
- request->NotifyConsumerWithResults(obtained_forms.Pass());
- return;
- } else if (allow_default_store()) {
- PasswordStoreDefault::GetBlacklistLoginsImpl(request.Pass());
- return;
- }
- // The consumer will be left hanging unless we reply.
- request->NotifyConsumerWithResults(ScopedVector<autofill::PasswordForm>());
-}
-
bool PasswordStoreX::FillAutofillableLogins(
ScopedVector<autofill::PasswordForm>* forms) {
CheckMigration();
if (use_native_backend() && backend_->GetAutofillableLogins(forms)) {
+ SortLoginsByOrigin(&forms->get());
// See GetLoginsImpl() for why we disallow fallback conditionally here.
- if (forms->size() > 0)
+ if (!forms->empty())
allow_fallback_ = false;
return true;
}
@@ -212,7 +175,8 @@ bool PasswordStoreX::FillBlacklistLogins(
CheckMigration();
if (use_native_backend() && backend_->GetBlacklistLogins(forms)) {
// See GetLoginsImpl() for why we disallow fallback conditionally here.
- if (forms->size() > 0)
+ SortLoginsByOrigin(&forms->get());
+ if (!forms->empty())
allow_fallback_ = false;
return true;
}
« no previous file with comments | « chrome/browser/password_manager/password_store_x.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698