| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual password_manager::PasswordStoreChangeList AddLogin( | 43 virtual password_manager::PasswordStoreChangeList AddLogin( |
| 44 const autofill::PasswordForm& form) = 0; | 44 const autofill::PasswordForm& form) = 0; |
| 45 virtual bool UpdateLogin( | 45 virtual bool UpdateLogin( |
| 46 const autofill::PasswordForm& form, | 46 const autofill::PasswordForm& form, |
| 47 password_manager::PasswordStoreChangeList* changes) = 0; | 47 password_manager::PasswordStoreChangeList* changes) = 0; |
| 48 virtual bool RemoveLogin(const autofill::PasswordForm& form) = 0; | 48 virtual bool RemoveLogin(const autofill::PasswordForm& form) = 0; |
| 49 | 49 |
| 50 // Removes all logins created/synced from |delete_begin| onwards (inclusive) | 50 // Removes all logins created/synced from |delete_begin| onwards (inclusive) |
| 51 // and before |delete_end|. You may use a null Time value to do an unbounded | 51 // and before |delete_end|. You may use a null Time value to do an unbounded |
| 52 // delete in either direction. | 52 // delete in either direction. |
| 53 virtual bool RemoveLoginsCreatedBetween(base::Time delete_begin, | 53 virtual bool RemoveLoginsCreatedBetween( |
| 54 base::Time delete_end) = 0; | 54 base::Time delete_begin, |
| 55 base::Time delete_end, |
| 56 password_manager::PasswordStoreChangeList* changes) = 0; |
| 55 virtual bool RemoveLoginsSyncedBetween( | 57 virtual bool RemoveLoginsSyncedBetween( |
| 56 base::Time delete_begin, | 58 base::Time delete_begin, |
| 57 base::Time delete_end, | 59 base::Time delete_end, |
| 58 password_manager::PasswordStoreChangeList* changes) = 0; | 60 password_manager::PasswordStoreChangeList* changes) = 0; |
| 59 | 61 |
| 60 virtual bool GetLogins(const autofill::PasswordForm& form, | 62 virtual bool GetLogins(const autofill::PasswordForm& form, |
| 61 PasswordFormList* forms) = 0; | 63 PasswordFormList* forms) = 0; |
| 62 virtual bool GetLoginsCreatedBetween(base::Time get_begin, | |
| 63 base::Time get_end, | |
| 64 PasswordFormList* forms) = 0; | |
| 65 virtual bool GetAutofillableLogins(PasswordFormList* forms) = 0; | 64 virtual bool GetAutofillableLogins(PasswordFormList* forms) = 0; |
| 66 virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0; | 65 virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0; |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 // 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 |
| 70 // case this PasswordStoreX will act the same as PasswordStoreDefault. | 69 // case this PasswordStoreX will act the same as PasswordStoreDefault. |
| 71 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 70 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| 72 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, | 71 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, |
| 73 password_manager::LoginDatabase* login_db, | 72 password_manager::LoginDatabase* login_db, |
| 74 NativeBackend* backend); | 73 NativeBackend* backend); |
| 75 | 74 |
| 76 private: | 75 private: |
| 77 friend class PasswordStoreXTest; | 76 friend class PasswordStoreXTest; |
| 78 | 77 |
| 79 virtual ~PasswordStoreX(); | 78 virtual ~PasswordStoreX(); |
| 80 | 79 |
| 81 // Implements PasswordStore interface. | 80 // Implements PasswordStore interface. |
| 82 virtual password_manager::PasswordStoreChangeList AddLoginImpl( | 81 virtual password_manager::PasswordStoreChangeList AddLoginImpl( |
| 83 const autofill::PasswordForm& form) OVERRIDE; | 82 const autofill::PasswordForm& form) OVERRIDE; |
| 84 virtual password_manager::PasswordStoreChangeList UpdateLoginImpl( | 83 virtual password_manager::PasswordStoreChangeList UpdateLoginImpl( |
| 85 const autofill::PasswordForm& form) OVERRIDE; | 84 const autofill::PasswordForm& form) OVERRIDE; |
| 86 virtual password_manager::PasswordStoreChangeList RemoveLoginImpl( | 85 virtual password_manager::PasswordStoreChangeList RemoveLoginImpl( |
| 87 const autofill::PasswordForm& form) OVERRIDE; | 86 const autofill::PasswordForm& form) OVERRIDE; |
| 88 virtual password_manager::PasswordStoreChangeList | 87 virtual password_manager::PasswordStoreChangeList |
| 89 RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin, | 88 RemoveLoginsCreatedBetweenImpl(base::Time delete_begin, |
| 90 const base::Time& delete_end) OVERRIDE; | 89 base::Time delete_end) OVERRIDE; |
| 91 virtual password_manager::PasswordStoreChangeList | 90 virtual password_manager::PasswordStoreChangeList |
| 92 RemoveLoginsSyncedBetweenImpl(base::Time delete_begin, | 91 RemoveLoginsSyncedBetweenImpl(base::Time delete_begin, |
| 93 base::Time delete_end) OVERRIDE; | 92 base::Time delete_end) OVERRIDE; |
| 94 virtual void GetLoginsImpl( | 93 virtual void GetLoginsImpl( |
| 95 const autofill::PasswordForm& form, | 94 const autofill::PasswordForm& form, |
| 96 AuthorizationPromptPolicy prompt_policy, | 95 AuthorizationPromptPolicy prompt_policy, |
| 97 const ConsumerCallbackRunner& callback_runner) OVERRIDE; | 96 const ConsumerCallbackRunner& callback_runner) OVERRIDE; |
| 98 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; | 97 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; |
| 99 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; | 98 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; |
| 100 virtual bool FillAutofillableLogins( | 99 virtual bool FillAutofillableLogins( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 128 // Whether we should allow falling back to the default store. If there is | 127 // Whether we should allow falling back to the default store. If there is |
| 129 // nothing to migrate, then the first attempt to use the native store will | 128 // nothing to migrate, then the first attempt to use the native store will |
| 130 // be the first time we try to use it and we should allow falling back. If | 129 // be the first time we try to use it and we should allow falling back. If |
| 131 // we have migrated successfully, then we do not allow falling back. | 130 // we have migrated successfully, then we do not allow falling back. |
| 132 bool allow_fallback_; | 131 bool allow_fallback_; |
| 133 | 132 |
| 134 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); | 133 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); |
| 135 }; | 134 }; |
| 136 | 135 |
| 137 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 136 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
| OLD | NEW |