// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT_H_ #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT_H_ #include #include "base/memory/scoped_ptr.h" #include "chrome/browser/password_manager/login_database.h" #include "chrome/browser/password_manager/password_store.h" class Profile; // Simple password store implementation that delegates everything to // the LoginDatabase. class PasswordStoreDefault : public PasswordStore { public: // Takes ownership of |login_db|. PasswordStoreDefault(LoginDatabase* login_db, Profile* profile); protected: virtual ~PasswordStoreDefault(); // Implements RefCountedProfileKeyedService. virtual void ShutdownOnUIThread() OVERRIDE; // Implements PasswordStore interface. virtual void ReportMetricsImpl() OVERRIDE; virtual void AddLoginImpl(const content::PasswordForm& form) OVERRIDE; virtual void UpdateLoginImpl( const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginImpl( const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl( const content::PasswordForm& form, const ConsumerCallbackRunner& callback_runner) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( std::vector* forms) OVERRIDE; virtual bool FillBlacklistLogins( std::vector* forms) OVERRIDE; protected: inline bool DeleteAndRecreateDatabaseFile() { return login_db_->DeleteAndRecreateDatabaseFile(); } private: scoped_ptr login_db_; Profile* profile_; DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault); }; #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT_H_