| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SIMPLE_PASSWORD_STORE_MAC_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_SIMPLE_PASSWORD_STORE_MAC_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_SIMPLE_PASSWORD_STORE_MAC_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_SIMPLE_PASSWORD_STORE_MAC_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/password_manager/core/browser/password_store_default.h" | 9 #include "components/password_manager/core/browser/password_store_default.h" |
| 10 | 10 |
| 11 class PrefService; |
| 12 |
| 11 // The same as PasswordStoreDefault but running on the dedicated thread. The | 13 // The same as PasswordStoreDefault but running on the dedicated thread. The |
| 12 // owner is responsible for the thread lifetime. | 14 // owner is responsible for the thread lifetime. |
| 13 class SimplePasswordStoreMac : public password_manager::PasswordStoreDefault { | 15 class SimplePasswordStoreMac : public password_manager::PasswordStoreDefault { |
| 14 public: | 16 public: |
| 15 // Passes the arguments to PasswordStoreDefault. |background_task_runner| and | 17 // Passes the arguments to PasswordStoreDefault. |background_task_runner| and |
| 16 // |login_db| can be overwritten later in InitWithTaskRunner(). | 18 // |login_db| can be overwritten later in InitWithTaskRunner(). |
| 17 SimplePasswordStoreMac( | 19 SimplePasswordStoreMac( |
| 18 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 20 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| 19 scoped_refptr<base::SingleThreadTaskRunner> background_thread_runner, | 21 scoped_refptr<base::SingleThreadTaskRunner> background_thread_runner, |
| 20 std::unique_ptr<password_manager::LoginDatabase> login_db); | 22 std::unique_ptr<password_manager::LoginDatabase> login_db); |
| 21 | 23 |
| 22 // Sets the background thread and LoginDatabase. |login_db| should be already | 24 // Sets the background thread and LoginDatabase. |login_db| should be already |
| 23 // inited. The method isn't necessary to call if the constructor already got | 25 // inited. The method isn't necessary to call if the constructor already got |
| 24 // the correct parameters. | 26 // the correct parameters. |
| 25 void InitWithTaskRunner( | 27 void InitWithTaskRunner( |
| 26 scoped_refptr<base::SingleThreadTaskRunner> background_task_runner, | 28 scoped_refptr<base::SingleThreadTaskRunner> background_task_runner, |
| 27 std::unique_ptr<password_manager::LoginDatabase> login_db); | 29 std::unique_ptr<password_manager::LoginDatabase> login_db); |
| 28 | 30 |
| 29 using PasswordStoreDefault::GetBackgroundTaskRunner; | 31 using PasswordStoreDefault::GetBackgroundTaskRunner; |
| 30 | 32 |
| 31 protected: | 33 protected: |
| 32 ~SimplePasswordStoreMac() override; | 34 ~SimplePasswordStoreMac() override; |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 bool Init(const syncer::SyncableService::StartSyncFlare& flare) override; | 37 bool Init(const syncer::SyncableService::StartSyncFlare& flare, |
| 38 PrefService* prefs) override; |
| 36 | 39 |
| 37 DISALLOW_COPY_AND_ASSIGN(SimplePasswordStoreMac); | 40 DISALLOW_COPY_AND_ASSIGN(SimplePasswordStoreMac); |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SIMPLE_PASSWORD_STORE_MAC_H_ | 43 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SIMPLE_PASSWORD_STORE_MAC_H_ |
| OLD | NEW |