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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0; | 51 virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0; |
52 }; | 52 }; |
53 | 53 |
54 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which | 54 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which |
55 // case this PasswordStoreX will act the same as PasswordStoreDefault. | 55 // case this PasswordStoreX will act the same as PasswordStoreDefault. |
56 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 56 PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
57 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, | 57 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, |
58 LoginDatabase* login_db, | 58 LoginDatabase* login_db, |
59 NativeBackend* backend); | 59 NativeBackend* backend); |
60 | 60 |
61 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | |
62 // Registers the pref setting used for the methods below. | |
63 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | |
64 | |
65 // Returns true if passwords have been tagged with the local profile id. | |
66 static bool PasswordsUseLocalProfileId(PrefService* prefs); | |
67 | |
68 // Sets the persistent bit indicating that passwords have been tagged with the | |
69 // local profile id. This cannot be unset; passwords get migrated only once. | |
70 // The caller promises that |prefs| will not be deleted any time soon. | |
71 static void SetPasswordsUseLocalProfileId(PrefService* prefs); | |
72 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | |
73 | |
74 private: | 61 private: |
75 friend class PasswordStoreXTest; | 62 friend class PasswordStoreXTest; |
76 | 63 |
77 virtual ~PasswordStoreX(); | 64 virtual ~PasswordStoreX(); |
78 | 65 |
79 // Implements PasswordStore interface. | 66 // Implements PasswordStore interface. |
80 virtual PasswordStoreChangeList AddLoginImpl( | 67 virtual PasswordStoreChangeList AddLoginImpl( |
81 const autofill::PasswordForm& form) OVERRIDE; | 68 const autofill::PasswordForm& form) OVERRIDE; |
82 virtual PasswordStoreChangeList UpdateLoginImpl( | 69 virtual PasswordStoreChangeList UpdateLoginImpl( |
83 const autofill::PasswordForm& form) OVERRIDE; | 70 const autofill::PasswordForm& form) OVERRIDE; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Whether we should allow falling back to the default store. If there is | 109 // Whether we should allow falling back to the default store. If there is |
123 // nothing to migrate, then the first attempt to use the native store will | 110 // nothing to migrate, then the first attempt to use the native store will |
124 // be the first time we try to use it and we should allow falling back. If | 111 // be the first time we try to use it and we should allow falling back. If |
125 // we have migrated successfully, then we do not allow falling back. | 112 // we have migrated successfully, then we do not allow falling back. |
126 bool allow_fallback_; | 113 bool allow_fallback_; |
127 | 114 |
128 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); | 115 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); |
129 }; | 116 }; |
130 | 117 |
131 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 118 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
OLD | NEW |