- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / password_manager / password_store_win.h
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.
4
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/password_manager/password_store_default.h"
10
11 class LoginDatabase;
12 class Profile;
13 class WebDataService;
14
15 namespace autofill {
16 struct PasswordForm;
17 }
18
19 // Windows PasswordStore implementation that uses the default implementation,
20 // but also uses IE7 passwords if no others found.
21 class PasswordStoreWin : public PasswordStoreDefault {
22  public:
23   // WebDataService is only used for IE7 password fetching.
24   PasswordStoreWin(LoginDatabase* login_database,
25                    Profile* profile,
26                    WebDataService* web_data_service);
27
28   // RefcountedBrowserContextKeyedService:
29   virtual void ShutdownOnUIThread() OVERRIDE;
30
31  private:
32   class DBHandler;
33
34   virtual ~PasswordStoreWin();
35
36   // Invoked from Shutdown, but run on the DB thread.
37   void ShutdownOnDBThread();
38
39   virtual void GetLoginsImpl(
40       const autofill::PasswordForm& form,
41       const ConsumerCallbackRunner& callback_runner) OVERRIDE;
42
43   void GetIE7LoginIfNecessary(
44     const autofill::PasswordForm& form,
45     const ConsumerCallbackRunner& callback_runner,
46     const std::vector<autofill::PasswordForm*>& matched_forms);
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_