| 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_X_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_vector.h" | |
| 15 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 16 #include "components/password_manager/core/browser/password_store_default.h" | 15 #include "components/password_manager/core/browser/password_store_default.h" |
| 17 | 16 |
| 18 namespace password_manager { | 17 namespace password_manager { |
| 19 class LoginDatabase; | 18 class LoginDatabase; |
| 20 } | 19 } |
| 21 | 20 |
| 22 // PasswordStoreX is used on Linux and other non-Windows, non-Mac OS X | 21 // PasswordStoreX is used on Linux and other non-Windows, non-Mac OS X |
| 23 // operating systems. It uses a "native backend" to actually store the password | 22 // operating systems. It uses a "native backend" to actually store the password |
| 24 // data when such a backend is available, and otherwise falls back to using the | 23 // data when such a backend is available, and otherwise falls back to using the |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Sets the 'skip_zero_click' flag to 'true' for all logins in the database | 65 // Sets the 'skip_zero_click' flag to 'true' for all logins in the database |
| 67 // that match |origin_filter|. | 66 // that match |origin_filter|. |
| 68 virtual bool DisableAutoSignInForOrigins( | 67 virtual bool DisableAutoSignInForOrigins( |
| 69 const base::Callback<bool(const GURL&)>& origin_filter, | 68 const base::Callback<bool(const GURL&)>& origin_filter, |
| 70 password_manager::PasswordStoreChangeList* changes) = 0; | 69 password_manager::PasswordStoreChangeList* changes) = 0; |
| 71 | 70 |
| 72 // The three methods below overwrite |forms| with all stored credentials | 71 // The three methods below overwrite |forms| with all stored credentials |
| 73 // matching |form|, all stored non-blacklisted credentials, and all stored | 72 // matching |form|, all stored non-blacklisted credentials, and all stored |
| 74 // blacklisted credentials, respectively. On success, they return true. | 73 // blacklisted credentials, respectively. On success, they return true. |
| 75 virtual bool GetLogins(const FormDigest& form, | 74 virtual bool GetLogins(const FormDigest& form, |
| 76 ScopedVector<autofill::PasswordForm>* forms) | 75 std::vector<std::unique_ptr<autofill::PasswordForm>>* |
| 76 forms) WARN_UNUSED_RESULT = 0; |
| 77 virtual bool GetAutofillableLogins( |
| 78 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) |
| 77 WARN_UNUSED_RESULT = 0; | 79 WARN_UNUSED_RESULT = 0; |
| 78 virtual bool GetAutofillableLogins( | 80 virtual bool GetBlacklistLogins( |
| 79 ScopedVector<autofill::PasswordForm>* forms) WARN_UNUSED_RESULT = 0; | 81 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) |
| 80 virtual bool GetBlacklistLogins(ScopedVector<autofill::PasswordForm>* forms) | |
| 81 WARN_UNUSED_RESULT = 0; | 82 WARN_UNUSED_RESULT = 0; |
| 82 virtual bool GetAllLogins(ScopedVector<autofill::PasswordForm>* forms) | 83 virtual bool GetAllLogins( |
| 84 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) |
| 83 WARN_UNUSED_RESULT = 0; | 85 WARN_UNUSED_RESULT = 0; |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which | 88 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which |
| 87 // case this PasswordStoreX will act the same as PasswordStoreDefault. | 89 // case this PasswordStoreX will act the same as PasswordStoreDefault. |
| 88 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 90 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| 89 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, | 91 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, |
| 90 std::unique_ptr<password_manager::LoginDatabase> login_db, | 92 std::unique_ptr<password_manager::LoginDatabase> login_db, |
| 91 NativeBackend* backend); | 93 NativeBackend* backend); |
| 92 | 94 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Whether we should allow falling back to the default store. If there is | 146 // Whether we should allow falling back to the default store. If there is |
| 145 // nothing to migrate, then the first attempt to use the native store will | 147 // nothing to migrate, then the first attempt to use the native store will |
| 146 // be the first time we try to use it and we should allow falling back. If | 148 // be the first time we try to use it and we should allow falling back. If |
| 147 // we have migrated successfully, then we do not allow falling back. | 149 // we have migrated successfully, then we do not allow falling back. |
| 148 bool allow_fallback_; | 150 bool allow_fallback_; |
| 149 | 151 |
| 150 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); | 152 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); |
| 151 }; | 153 }; |
| 152 | 154 |
| 153 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 155 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
| OLD | NEW |