Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / password_manager / password_store_win.h
blob3501b2eea10831c72e42b4c4212294d9200f7511
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_WIN_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/password_manager/core/browser/password_store_default.h"
11 class PasswordWebDataService;
13 namespace autofill {
14 struct PasswordForm;
17 namespace password_manager {
18 class LoginDatabase;
21 // Windows PasswordStore implementation that uses the default implementation,
22 // but also uses IE7 passwords if no others found.
23 class PasswordStoreWin : public password_manager::PasswordStoreDefault {
24 public:
25 // The |login_db| must not have been Init()-ed yet. It will be initialized in
26 // a deferred manner on the DB thread. The |web_data_service| is only used for
27 // IE7 password fetching.
28 PasswordStoreWin(
29 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
30 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
31 scoped_ptr<password_manager::LoginDatabase> login_db,
32 const scoped_refptr<PasswordWebDataService>& web_data_service);
34 // PasswordStore:
35 void Shutdown() override;
37 private:
38 class DBHandler;
40 ~PasswordStoreWin() override;
42 // Invoked from Shutdown, but run on the DB thread.
43 void ShutdownOnDBThread();
45 // password_manager::PasswordStore:
46 void GetLoginsImpl(const autofill::PasswordForm& form,
47 AuthorizationPromptPolicy prompt_policy,
48 scoped_ptr<GetLoginsRequest> request) override;
50 scoped_ptr<DBHandler> db_handler_;
52 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin);
55 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_