1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_SYNC_INTERFACE_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_SYNC_INTERFACE_H_
10 #include "components/password_manager/core/browser/password_store_change.h"
12 namespace password_manager {
14 // PasswordStore interface for PasswordSyncableService. It provides access to
15 // synchronous methods of PasswordStore which shouldn't be accessible to other
16 // classes. These methods are to be called on the PasswordStore background
18 class PasswordStoreSync {
20 // Finds all non-blacklist PasswordForms, and fills the vector.
21 virtual bool FillAutofillableLogins(
22 std::vector<autofill::PasswordForm*>* forms) = 0;
24 // Finds all blacklist PasswordForms, and fills the vector.
25 virtual bool FillBlacklistLogins(
26 std::vector<autofill::PasswordForm*>* forms) = 0;
28 // Synchronous implementation to add the given login.
29 virtual PasswordStoreChangeList AddLoginImpl(
30 const autofill::PasswordForm& form) = 0;
32 // Synchronous implementation to update the given login.
33 virtual PasswordStoreChangeList UpdateLoginImpl(
34 const autofill::PasswordForm& form) = 0;
36 // Synchronous implementation to remove the given login.
37 virtual PasswordStoreChangeList RemoveLoginImpl(
38 const autofill::PasswordForm& form) = 0;
40 // Notifies observers that password store data may have been changed.
41 virtual void NotifyLoginsChanged(const PasswordStoreChangeList& changes) = 0;
44 virtual ~PasswordStoreSync();
47 } // namespace password_manager
49 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_SYNC_INTERFACE_H_