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_MAC_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
15 #include "components/password_manager/core/browser/login_database.h" | 15 #include "components/password_manager/core/browser/login_database.h" |
16 #include "components/password_manager/core/browser/password_store.h" | 16 #include "components/password_manager/core/browser/password_store.h" |
17 | 17 |
18 namespace crypto { | 18 namespace crypto { |
19 class AppleKeychain; | 19 class AppleKeychain; |
20 } | 20 } |
21 | 21 |
22 namespace password_manager { | 22 namespace password_manager { |
23 class LoginDatabase; | 23 class LoginDatabase; |
24 } | 24 } |
25 | 25 |
| 26 class PrefService; |
| 27 |
26 // TODO(vasilii): Deprecate this class. The class should be used by | 28 // TODO(vasilii): Deprecate this class. The class should be used by |
27 // PasswordStoreProxyMac wrapper. | 29 // PasswordStoreProxyMac wrapper. |
28 // Implements PasswordStore on top of the OS X Keychain, with an internal | 30 // Implements PasswordStore on top of the OS X Keychain, with an internal |
29 // database for extra metadata. For an overview of the interactions with the | 31 // database for extra metadata. For an overview of the interactions with the |
30 // Keychain, as well as the rationale for some of the behaviors, see the | 32 // Keychain, as well as the rationale for some of the behaviors, see the |
31 // Keychain integration design doc: | 33 // Keychain integration design doc: |
32 // http://dev.chromium.org/developers/design-documents/os-x-password-manager-key
chain-integration | 34 // http://dev.chromium.org/developers/design-documents/os-x-password-manager-key
chain-integration |
33 class PasswordStoreMac : public password_manager::PasswordStore { | 35 class PasswordStoreMac : public password_manager::PasswordStore { |
34 public: | 36 public: |
35 enum MigrationResult { | 37 enum MigrationResult { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 72 |
71 void set_login_metadata_db(password_manager::LoginDatabase* login_db); | 73 void set_login_metadata_db(password_manager::LoginDatabase* login_db); |
72 | 74 |
73 // To be used for testing. | 75 // To be used for testing. |
74 crypto::AppleKeychain* keychain() const { return keychain_.get(); } | 76 crypto::AppleKeychain* keychain() const { return keychain_.get(); } |
75 | 77 |
76 protected: | 78 protected: |
77 ~PasswordStoreMac() override; | 79 ~PasswordStoreMac() override; |
78 | 80 |
79 private: | 81 private: |
80 bool Init(const syncer::SyncableService::StartSyncFlare& flare) override; | 82 bool Init(const syncer::SyncableService::StartSyncFlare& flare, |
| 83 PrefService* prefs) override; |
81 void ReportMetricsImpl(const std::string& sync_username, | 84 void ReportMetricsImpl(const std::string& sync_username, |
82 bool custom_passphrase_sync_enabled) override; | 85 bool custom_passphrase_sync_enabled) override; |
83 password_manager::PasswordStoreChangeList AddLoginImpl( | 86 password_manager::PasswordStoreChangeList AddLoginImpl( |
84 const autofill::PasswordForm& form) override; | 87 const autofill::PasswordForm& form) override; |
85 password_manager::PasswordStoreChangeList UpdateLoginImpl( | 88 password_manager::PasswordStoreChangeList UpdateLoginImpl( |
86 const autofill::PasswordForm& form) override; | 89 const autofill::PasswordForm& form) override; |
87 password_manager::PasswordStoreChangeList RemoveLoginImpl( | 90 password_manager::PasswordStoreChangeList RemoveLoginImpl( |
88 const autofill::PasswordForm& form) override; | 91 const autofill::PasswordForm& form) override; |
89 password_manager::PasswordStoreChangeList RemoveLoginsByURLAndTimeImpl( | 92 password_manager::PasswordStoreChangeList RemoveLoginsByURLAndTimeImpl( |
90 const base::Callback<bool(const GURL&)>& url_filter, | 93 const base::Callback<bool(const GURL&)>& url_filter, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 std::unique_ptr<crypto::AppleKeychain> keychain_; | 148 std::unique_ptr<crypto::AppleKeychain> keychain_; |
146 | 149 |
147 // The login metadata SQL database. The caller is resonsible for initializing | 150 // The login metadata SQL database. The caller is resonsible for initializing |
148 // it. | 151 // it. |
149 password_manager::LoginDatabase* login_metadata_db_; | 152 password_manager::LoginDatabase* login_metadata_db_; |
150 | 153 |
151 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); | 154 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); |
152 }; | 155 }; |
153 | 156 |
154 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 157 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
OLD | NEW |