Commit f1f15de9 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Passwords] Clean up password store sync interface

This CL moves
FillAutofillableLogins() and FillBlacklistLogins() APIs
PasswordStoreSync to PasswordStore.

After the removal of PasswordSyncableService those APIs aren't needed
in PasswordStoreSync anymore.

Bug: 925307
Change-Id: I4a92be1165e26c63cced1c9ff3344289d16df4b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312820Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790954}
parent fcb4576b
......@@ -38,7 +38,7 @@ class PrefService;
namespace autofill {
struct FormData;
struct PasswordForm;
}
} // namespace autofill
namespace syncer {
class ModelTypeControllerDelegate;
......@@ -538,6 +538,18 @@ class PasswordStore : protected PasswordStoreSync,
virtual std::vector<std::unique_ptr<autofill::PasswordForm>>
FillMatchingLoginsByPassword(const base::string16& plain_text_password) = 0;
// Overwrites |forms| with all stored non-blacklisted credentials. Returns
// true on success.
virtual bool FillAutofillableLogins(
std::vector<std::unique_ptr<autofill::PasswordForm>>* forms)
WARN_UNUSED_RESULT = 0;
// Overwrites |forms| with all stored blacklisted credentials. Returns true on
// success.
virtual bool FillBlacklistLogins(
std::vector<std::unique_ptr<autofill::PasswordForm>>* forms)
WARN_UNUSED_RESULT = 0;
// Synchronous implementation for manipulating with statistics.
virtual void AddSiteStatsImpl(const InteractionsStats& stats) = 0;
virtual void RemoveSiteStatsImpl(const GURL& origin_domain) = 0;
......
......@@ -120,20 +120,6 @@ class PasswordStoreSync {
PasswordStoreSync();
// TODO(http://crbug.com/925307) Move the following 2 APIs to PasswordStore
// upon full migration to USS Sync architecture.
// Overwrites |forms| with all stored non-blacklisted credentials. Returns
// true on success.
virtual bool FillAutofillableLogins(
std::vector<std::unique_ptr<autofill::PasswordForm>>* forms)
WARN_UNUSED_RESULT = 0;
// Overwrites |forms| with all stored blacklisted credentials. Returns true on
// success.
virtual bool FillBlacklistLogins(
std::vector<std::unique_ptr<autofill::PasswordForm>>* forms)
WARN_UNUSED_RESULT = 0;
// Overwrites |key_to_form_map| with a map from the DB primary key to the
// corresponding form for all stored credentials. Returns true on success.
virtual FormRetrievalResult ReadAllLogins(
......
......@@ -201,10 +201,6 @@ class MockSyncMetadataStore : public PasswordStoreSync::MetadataStore {
class MockPasswordStoreSync : public PasswordStoreSync {
public:
MOCK_METHOD1(FillAutofillableLogins,
bool(std::vector<std::unique_ptr<autofill::PasswordForm>>*));
MOCK_METHOD1(FillBlacklistLogins,
bool(std::vector<std::unique_ptr<autofill::PasswordForm>>*));
MOCK_METHOD1(ReadAllLogins, FormRetrievalResult(PrimaryKeyToFormMap*));
MOCK_METHOD1(RemoveLoginByPrimaryKeySync, PasswordStoreChangeList(int));
MOCK_METHOD0(DeleteUndecryptableLogins, DatabaseCleanupResult());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment