e96973f3237134e84e7d1337692d2bf541adb0ba
[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 "components/password_manager/core/browser/password_store_default.h"
10
11 class LoginDatabase;
12 class WebDataService;
13
14 namespace autofill {
15 struct PasswordForm;
16 }
17
18 // Windows PasswordStore implementation that uses the default implementation,
19 // but also uses IE7 passwords if no others found.
20 class PasswordStoreWin : public PasswordStoreDefault {
21  public:
22   // WebDataService is only used for IE7 password fetching.
23   PasswordStoreWin(
24       scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
25       scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
26       LoginDatabase* login_database,
27       WebDataService* web_data_service);
28
29   // PasswordStore:
30   virtual void Shutdown() OVERRIDE;
31
32  private:
33   class DBHandler;
34
35   virtual ~PasswordStoreWin();
36
37   // Invoked from Shutdown, but run on the DB thread.
38   void ShutdownOnDBThread();
39
40   virtual void GetLoginsImpl(
41       const autofill::PasswordForm& form,
42       AuthorizationPromptPolicy prompt_policy,
43       const ConsumerCallbackRunner& callback_runner) OVERRIDE;
44
45   void GetIE7LoginIfNecessary(
46     const autofill::PasswordForm& form,
47     const ConsumerCallbackRunner& callback_runner,
48     const std::vector<autofill::PasswordForm*>& matched_forms);
49
50   scoped_ptr<DBHandler> db_handler_;
51
52   DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin);
53 };
54
55 #endif  // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_