Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / password_manager / password_store_default.h
blob16eac832a4d5b8d296ded094ab1e0283fd22df93
1 // Copyright (c) 2012 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 CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT_H_
8 #include <vector>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/password_manager/login_database.h"
12 #include "chrome/browser/password_manager/password_store.h"
14 class Profile;
16 // Simple password store implementation that delegates everything to
17 // the LoginDatabase.
18 class PasswordStoreDefault : public PasswordStore {
19 public:
20 // Takes ownership of |login_db|.
21 PasswordStoreDefault(LoginDatabase* login_db,
22 Profile* profile);
24 protected:
25 virtual ~PasswordStoreDefault();
27 // Implements RefCountedBrowserContextKeyedService.
28 virtual void ShutdownOnUIThread() OVERRIDE;
30 // Implements PasswordStore interface.
31 virtual void ReportMetricsImpl() OVERRIDE;
32 virtual void AddLoginImpl(const autofill::PasswordForm& form) OVERRIDE;
33 virtual void UpdateLoginImpl(
34 const autofill::PasswordForm& form) OVERRIDE;
35 virtual void RemoveLoginImpl(
36 const autofill::PasswordForm& form) OVERRIDE;
37 virtual void RemoveLoginsCreatedBetweenImpl(
38 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE;
39 virtual void GetLoginsImpl(
40 const autofill::PasswordForm& form,
41 AuthorizationPromptPolicy prompt_policy,
42 const ConsumerCallbackRunner& callback_runner) OVERRIDE;
43 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE;
44 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE;
45 virtual bool FillAutofillableLogins(
46 std::vector<autofill::PasswordForm*>* forms) OVERRIDE;
47 virtual bool FillBlacklistLogins(
48 std::vector<autofill::PasswordForm*>* forms) OVERRIDE;
50 protected:
51 inline bool DeleteAndRecreateDatabaseFile() {
52 return login_db_->DeleteAndRecreateDatabaseFile();
55 private:
56 scoped_ptr<LoginDatabase> login_db_;
57 Profile* profile_;
59 DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault);
62 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT_H_