| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "components/password_manager/core/browser/password_store_default.h" | 11 #include "components/password_manager/core/browser/password_store_default.h" |
| 11 | 12 |
| 12 class PasswordWebDataService; | 13 class PasswordWebDataService; |
| 13 | 14 |
| 14 namespace autofill { | 15 namespace autofill { |
| 15 struct PasswordForm; | 16 struct PasswordForm; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace password_manager { | 19 namespace password_manager { |
| 19 class LoginDatabase; | 20 class LoginDatabase; |
| 20 } | 21 } |
| 21 | 22 |
| 22 // Windows PasswordStore implementation that uses the default implementation, | 23 // Windows PasswordStore implementation that uses the default implementation, |
| 23 // but also uses IE7 passwords if no others found. | 24 // but also uses IE7 passwords if no others found. |
| 24 class PasswordStoreWin : public password_manager::PasswordStoreDefault { | 25 class PasswordStoreWin : public password_manager::PasswordStoreDefault { |
| 25 public: | 26 public: |
| 26 // The |login_db| must not have been Init()-ed yet. It will be initialized in | 27 // The |login_db| must not have been Init()-ed yet. It will be initialized in |
| 27 // a deferred manner on the DB thread. The |web_data_service| is only used for | 28 // a deferred manner on the DB thread. The |web_data_service| is only used for |
| 28 // IE7 password fetching. | 29 // IE7 password fetching. |
| 29 PasswordStoreWin( | 30 PasswordStoreWin( |
| 30 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 31 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| 31 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, | 32 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, |
| 32 scoped_ptr<password_manager::LoginDatabase> login_db, | 33 std::unique_ptr<password_manager::LoginDatabase> login_db, |
| 33 const scoped_refptr<PasswordWebDataService>& web_data_service); | 34 const scoped_refptr<PasswordWebDataService>& web_data_service); |
| 34 | 35 |
| 35 // PasswordStore: | 36 // PasswordStore: |
| 36 void ShutdownOnUIThread() override; | 37 void ShutdownOnUIThread() override; |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 class DBHandler; | 40 class DBHandler; |
| 40 | 41 |
| 41 ~PasswordStoreWin() override; | 42 ~PasswordStoreWin() override; |
| 42 | 43 |
| 43 // Invoked from ShutdownOnUIThread, but run on the DB thread. | 44 // Invoked from ShutdownOnUIThread, but run on the DB thread. |
| 44 void ShutdownOnDBThread(); | 45 void ShutdownOnDBThread(); |
| 45 | 46 |
| 46 // password_manager::PasswordStore: | 47 // password_manager::PasswordStore: |
| 47 void GetLoginsImpl(const autofill::PasswordForm& form, | 48 void GetLoginsImpl(const autofill::PasswordForm& form, |
| 48 scoped_ptr<GetLoginsRequest> request) override; | 49 std::unique_ptr<GetLoginsRequest> request) override; |
| 49 | 50 |
| 50 scoped_ptr<DBHandler> db_handler_; | 51 std::unique_ptr<DBHandler> db_handler_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin); | 53 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ | 56 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ |
| OLD | NEW |