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 28 matching lines...) Expand all Loading... |
39 virtual ~NativeBackend() {} | 39 virtual ~NativeBackend() {} |
40 | 40 |
41 virtual bool Init() = 0; | 41 virtual bool Init() = 0; |
42 | 42 |
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 virtual bool RemoveLoginsCreatedBetween(const base::Time& delete_begin, | 49 virtual bool RemoveLoginsCreatedBetween(base::Time delete_begin, |
50 const base::Time& delete_end) = 0; | 50 base::Time delete_end) = 0; |
| 51 virtual bool RemoveLoginsSyncedBetween( |
| 52 base::Time delete_begin, base::Time delete_end, |
| 53 password_manager::PasswordStoreChangeList* changes) = 0; |
51 virtual bool GetLogins(const autofill::PasswordForm& form, | 54 virtual bool GetLogins(const autofill::PasswordForm& form, |
52 PasswordFormList* forms) = 0; | 55 PasswordFormList* forms) = 0; |
53 virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, | 56 virtual bool GetLoginsCreatedBetween(base::Time get_begin, |
54 const base::Time& get_end, | 57 base::Time get_end, |
55 PasswordFormList* forms) = 0; | 58 PasswordFormList* forms) = 0; |
56 virtual bool GetAutofillableLogins(PasswordFormList* forms) = 0; | 59 virtual bool GetAutofillableLogins(PasswordFormList* forms) = 0; |
57 virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0; | 60 virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0; |
58 }; | 61 }; |
59 | 62 |
60 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which | 63 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which |
61 // case this PasswordStoreX will act the same as PasswordStoreDefault. | 64 // case this PasswordStoreX will act the same as PasswordStoreDefault. |
62 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 65 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
63 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, | 66 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, |
64 password_manager::LoginDatabase* login_db, | 67 password_manager::LoginDatabase* login_db, |
65 NativeBackend* backend); | 68 NativeBackend* backend); |
66 | 69 |
67 private: | 70 private: |
68 friend class PasswordStoreXTest; | 71 friend class PasswordStoreXTest; |
69 | 72 |
70 virtual ~PasswordStoreX(); | 73 virtual ~PasswordStoreX(); |
71 | 74 |
72 // Implements PasswordStore interface. | 75 // Implements PasswordStore interface. |
73 virtual password_manager::PasswordStoreChangeList AddLoginImpl( | 76 virtual password_manager::PasswordStoreChangeList AddLoginImpl( |
74 const autofill::PasswordForm& form) OVERRIDE; | 77 const autofill::PasswordForm& form) OVERRIDE; |
75 virtual password_manager::PasswordStoreChangeList UpdateLoginImpl( | 78 virtual password_manager::PasswordStoreChangeList UpdateLoginImpl( |
76 const autofill::PasswordForm& form) OVERRIDE; | 79 const autofill::PasswordForm& form) OVERRIDE; |
77 virtual password_manager::PasswordStoreChangeList RemoveLoginImpl( | 80 virtual password_manager::PasswordStoreChangeList RemoveLoginImpl( |
78 const autofill::PasswordForm& form) OVERRIDE; | 81 const autofill::PasswordForm& form) OVERRIDE; |
79 virtual password_manager::PasswordStoreChangeList | 82 virtual password_manager::PasswordStoreChangeList |
80 RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin, | 83 RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin, |
81 const base::Time& delete_end) OVERRIDE; | 84 const base::Time& delete_end) OVERRIDE; |
| 85 virtual password_manager::PasswordStoreChangeList |
| 86 RemoveLoginsSyncedBetweenImpl(const base::Time& delete_begin, |
| 87 const base::Time& delete_end) OVERRIDE; |
82 virtual void GetLoginsImpl( | 88 virtual void GetLoginsImpl( |
83 const autofill::PasswordForm& form, | 89 const autofill::PasswordForm& form, |
84 AuthorizationPromptPolicy prompt_policy, | 90 AuthorizationPromptPolicy prompt_policy, |
85 const ConsumerCallbackRunner& callback_runner) OVERRIDE; | 91 const ConsumerCallbackRunner& callback_runner) OVERRIDE; |
86 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; | 92 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; |
87 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; | 93 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; |
88 virtual bool FillAutofillableLogins( | 94 virtual bool FillAutofillableLogins( |
89 std::vector<autofill::PasswordForm*>* forms) OVERRIDE; | 95 std::vector<autofill::PasswordForm*>* forms) OVERRIDE; |
90 virtual bool FillBlacklistLogins( | 96 virtual bool FillBlacklistLogins( |
91 std::vector<autofill::PasswordForm*>* forms) OVERRIDE; | 97 std::vector<autofill::PasswordForm*>* forms) OVERRIDE; |
(...skipping 24 matching lines...) Expand all Loading... |
116 // Whether we should allow falling back to the default store. If there is | 122 // Whether we should allow falling back to the default store. If there is |
117 // nothing to migrate, then the first attempt to use the native store will | 123 // nothing to migrate, then the first attempt to use the native store will |
118 // be the first time we try to use it and we should allow falling back. If | 124 // be the first time we try to use it and we should allow falling back. If |
119 // we have migrated successfully, then we do not allow falling back. | 125 // we have migrated successfully, then we do not allow falling back. |
120 bool allow_fallback_; | 126 bool allow_fallback_; |
121 | 127 |
122 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); | 128 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); |
123 }; | 129 }; |
124 | 130 |
125 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 131 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
OLD | NEW |