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_PASSWORD_STORE_PROXY_MAC_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_PROXY_MAC_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "components/password_manager/core/browser/keychain_migration_status_mac
.h" | 12 #include "components/password_manager/core/browser/keychain_migration_status_mac
.h" |
13 #include "components/password_manager/core/browser/password_store_default.h" | 13 #include "components/password_manager/core/browser/password_store_default.h" |
14 #include "components/prefs/pref_member.h" | 14 #include "components/prefs/pref_member.h" |
15 | 15 |
16 namespace password_manager { | 16 namespace password_manager { |
17 class LoginDatabase; | 17 class LoginDatabase; |
18 } | 18 } |
19 | 19 |
20 // Password store for Mac. It creates a dedicated background thread | 20 // Password store for Mac. It creates a dedicated background thread |
21 class PasswordStoreProxyMac : public password_manager::PasswordStoreDefault { | 21 class PasswordStoreMac : public password_manager::PasswordStoreDefault { |
22 public: | 22 public: |
23 PasswordStoreProxyMac( | 23 PasswordStoreMac( |
24 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 24 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
25 std::unique_ptr<password_manager::LoginDatabase> login_db, | 25 std::unique_ptr<password_manager::LoginDatabase> login_db, |
26 PrefService* prefs); | 26 PrefService* prefs); |
27 | 27 |
28 // PasswordStore: | 28 // PasswordStore: |
29 bool Init(const syncer::SyncableService::StartSyncFlare& flare, | 29 bool Init(const syncer::SyncableService::StartSyncFlare& flare, |
30 PrefService* prefs) override; | 30 PrefService* prefs) override; |
31 void ShutdownOnUIThread() override; | 31 void ShutdownOnUIThread() override; |
32 scoped_refptr<base::SingleThreadTaskRunner> GetBackgroundTaskRunner() | 32 scoped_refptr<base::SingleThreadTaskRunner> GetBackgroundTaskRunner() |
33 override; | 33 override; |
34 | 34 |
35 #if defined(UNIT_TEST) | 35 #if defined(UNIT_TEST) |
36 password_manager::LoginDatabase* login_metadata_db() { return login_db(); } | 36 password_manager::LoginDatabase* login_metadata_db() { return login_db(); } |
37 #endif | 37 #endif |
38 | 38 |
39 private: | 39 private: |
40 ~PasswordStoreProxyMac() override; | 40 ~PasswordStoreMac() override; |
41 | 41 |
42 void InitOnBackgroundThread(password_manager::MigrationStatus status); | 42 void InitOnBackgroundThread(password_manager::MigrationStatus status); |
43 | 43 |
44 // Writes status to the prefs. | 44 // Writes status to the prefs. |
45 void UpdateStatusPref(password_manager::MigrationStatus status); | 45 void UpdateStatusPref(password_manager::MigrationStatus status); |
46 | 46 |
47 // Thread that the synchronous methods are run on. | 47 // Thread that the synchronous methods are run on. |
48 std::unique_ptr<base::Thread> thread_; | 48 std::unique_ptr<base::Thread> thread_; |
49 | 49 |
50 // Current migration status for the profile. | 50 // Current migration status for the profile. |
51 IntegerPrefMember migration_status_; | 51 IntegerPrefMember migration_status_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(PasswordStoreProxyMac); | 53 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); |
54 }; | 54 }; |
55 | 55 |
56 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_PROXY_MAC_H_ | 56 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
OLD | NEW |