#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "components/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_store.h"
class PasswordStoreDefault : public PasswordStore {
public:
PasswordStoreDefault(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
LoginDatabase* login_db);
protected:
virtual ~PasswordStoreDefault();
virtual void ReportMetricsImpl() OVERRIDE;
virtual PasswordStoreChangeList AddLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
virtual PasswordStoreChangeList UpdateLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
virtual PasswordStoreChangeList RemoveLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
virtual PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE;
virtual void GetLoginsImpl(
const autofill::PasswordForm& form,
AuthorizationPromptPolicy prompt_policy,
const ConsumerCallbackRunner& callback_runner) OVERRIDE;
virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE;
virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE;
virtual bool FillAutofillableLogins(
std::vector<autofill::PasswordForm*>* forms) OVERRIDE;
virtual bool FillBlacklistLogins(
std::vector<autofill::PasswordForm*>* forms) OVERRIDE;
protected:
inline bool DeleteAndRecreateDatabaseFile() {
return login_db_->DeleteAndRecreateDatabaseFile();
}
private:
scoped_ptr<LoginDatabase> login_db_;
DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault);
};
#endif