1// Copyright (c) 2011 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.
4
5#ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
6#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
7#pragma once
8
9#include "base/scoped_ptr.h"
10#include "chrome/browser/password_manager/password_store_default.h"
11
12class LoginDatabase;
13class Profile;
14class WebDataService;
15
16namespace webkit_glue {
17struct PasswordForm;
18}
19
20// Windows PasswordStore implementation that uses the default implementation,
21// but also uses IE7 passwords if no others found.
22class PasswordStoreWin : public PasswordStoreDefault {
23 public:
24  // FilePath specifies path to WebDatabase.
25  PasswordStoreWin(LoginDatabase* login_database,
26                   Profile* profile,
27                   WebDataService* web_data_service);
28
29 private:
30  class DBHandler;
31
32  virtual ~PasswordStoreWin();
33
34  // Invoked from Shutdown, but run on the DB thread.
35  void ShutdownOnDBThread();
36
37  virtual GetLoginsRequest* NewGetLoginsRequest(
38      GetLoginsCallback* callback) OVERRIDE;
39
40  // See PasswordStoreDefault.
41  virtual void Shutdown() OVERRIDE;
42  virtual void ForwardLoginsResult(GetLoginsRequest* request) OVERRIDE;
43
44  // Overridden so that we can save the form for later use.
45  virtual void GetLoginsImpl(GetLoginsRequest* request,
46                             const webkit_glue::PasswordForm& form) OVERRIDE;
47
48  scoped_ptr<DBHandler> db_handler_;
49
50  DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin);
51};
52
53#endif  // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
54