| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which | 68 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which |
| 69 // case this PasswordStoreX will act the same as PasswordStoreDefault. | 69 // case this PasswordStoreX will act the same as PasswordStoreDefault. |
| 70 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 70 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| 71 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, | 71 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, |
| 72 password_manager::LoginDatabase* login_db, | 72 password_manager::LoginDatabase* login_db, |
| 73 NativeBackend* backend); | 73 NativeBackend* backend); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend class PasswordStoreXTest; | 76 friend class PasswordStoreXTest; |
| 77 | 77 |
| 78 virtual ~PasswordStoreX(); | 78 ~PasswordStoreX() override; |
| 79 | 79 |
| 80 // Implements PasswordStore interface. | 80 // Implements PasswordStore interface. |
| 81 virtual password_manager::PasswordStoreChangeList AddLoginImpl( | 81 password_manager::PasswordStoreChangeList AddLoginImpl( |
| 82 const autofill::PasswordForm& form) override; | 82 const autofill::PasswordForm& form) override; |
| 83 virtual password_manager::PasswordStoreChangeList UpdateLoginImpl( | 83 password_manager::PasswordStoreChangeList UpdateLoginImpl( |
| 84 const autofill::PasswordForm& form) override; | 84 const autofill::PasswordForm& form) override; |
| 85 virtual password_manager::PasswordStoreChangeList RemoveLoginImpl( | 85 password_manager::PasswordStoreChangeList RemoveLoginImpl( |
| 86 const autofill::PasswordForm& form) override; | 86 const autofill::PasswordForm& form) override; |
| 87 virtual password_manager::PasswordStoreChangeList | 87 password_manager::PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl( |
| 88 RemoveLoginsCreatedBetweenImpl(base::Time delete_begin, | 88 base::Time delete_begin, |
| 89 base::Time delete_end) override; | 89 base::Time delete_end) override; |
| 90 virtual password_manager::PasswordStoreChangeList | 90 password_manager::PasswordStoreChangeList RemoveLoginsSyncedBetweenImpl( |
| 91 RemoveLoginsSyncedBetweenImpl(base::Time delete_begin, | 91 base::Time delete_begin, |
| 92 base::Time delete_end) override; | 92 base::Time delete_end) override; |
| 93 virtual void GetLoginsImpl( | 93 void GetLoginsImpl(const autofill::PasswordForm& form, |
| 94 const autofill::PasswordForm& form, | 94 AuthorizationPromptPolicy prompt_policy, |
| 95 AuthorizationPromptPolicy prompt_policy, | 95 const ConsumerCallbackRunner& callback_runner) override; |
| 96 const ConsumerCallbackRunner& callback_runner) override; | 96 void GetAutofillableLoginsImpl(GetLoginsRequest* request) override; |
| 97 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) override; | 97 void GetBlacklistLoginsImpl(GetLoginsRequest* request) override; |
| 98 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) override; | 98 bool FillAutofillableLogins( |
| 99 virtual bool FillAutofillableLogins( | |
| 100 std::vector<autofill::PasswordForm*>* forms) override; | 99 std::vector<autofill::PasswordForm*>* forms) override; |
| 101 virtual bool FillBlacklistLogins( | 100 bool FillBlacklistLogins( |
| 102 std::vector<autofill::PasswordForm*>* forms) override; | 101 std::vector<autofill::PasswordForm*>* forms) override; |
| 103 | 102 |
| 104 // Sort logins by origin, like the ORDER BY clause in login_database.cc. | 103 // Sort logins by origin, like the ORDER BY clause in login_database.cc. |
| 105 void SortLoginsByOrigin(NativeBackend::PasswordFormList* list); | 104 void SortLoginsByOrigin(NativeBackend::PasswordFormList* list); |
| 106 | 105 |
| 107 // Check to see whether migration is necessary, and perform it if so. | 106 // Check to see whether migration is necessary, and perform it if so. |
| 108 void CheckMigration(); | 107 void CheckMigration(); |
| 109 | 108 |
| 110 // Return true if we should try using the native backend. | 109 // Return true if we should try using the native backend. |
| 111 bool use_native_backend() { return !!backend_.get(); } | 110 bool use_native_backend() { return !!backend_.get(); } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 127 // Whether we should allow falling back to the default store. If there is | 126 // Whether we should allow falling back to the default store. If there is |
| 128 // nothing to migrate, then the first attempt to use the native store will | 127 // nothing to migrate, then the first attempt to use the native store will |
| 129 // be the first time we try to use it and we should allow falling back. If | 128 // be the first time we try to use it and we should allow falling back. If |
| 130 // we have migrated successfully, then we do not allow falling back. | 129 // we have migrated successfully, then we do not allow falling back. |
| 131 bool allow_fallback_; | 130 bool allow_fallback_; |
| 132 | 131 |
| 133 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); | 132 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); |
| 134 }; | 133 }; |
| 135 | 134 |
| 136 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 135 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
| OLD | NEW |