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" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "chrome/browser/password_manager/password_store_default.h" | 12 #include "chrome/browser/password_manager/password_store_default.h" |
13 | 13 |
14 class LoginDatabase; | 14 class LoginDatabase; |
15 class PrefService; | 15 class PrefService; |
| 16 class Profile; |
| 17 |
| 18 namespace user_prefs { |
16 class PrefRegistrySyncable; | 19 class PrefRegistrySyncable; |
17 class Profile; | 20 } |
18 | 21 |
19 // PasswordStoreX is used on Linux and other non-Windows, non-Mac OS X | 22 // PasswordStoreX is used on Linux and other non-Windows, non-Mac OS X |
20 // operating systems. It uses a "native backend" to actually store the password | 23 // operating systems. It uses a "native backend" to actually store the password |
21 // data when such a backend is available, and otherwise falls back to using the | 24 // data when such a backend is available, and otherwise falls back to using the |
22 // login database like PasswordStoreDefault. It also handles automatically | 25 // login database like PasswordStoreDefault. It also handles automatically |
23 // migrating password data to a native backend from the login database. | 26 // migrating password data to a native backend from the login database. |
24 // | 27 // |
25 // There are currently native backends for GNOME Keyring and KWallet. | 28 // There are currently native backends for GNOME Keyring and KWallet. |
26 class PasswordStoreX : public PasswordStoreDefault { | 29 class PasswordStoreX : public PasswordStoreDefault { |
27 public: | 30 public: |
(...skipping 22 matching lines...) Expand all Loading... |
50 }; | 53 }; |
51 | 54 |
52 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which | 55 // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which |
53 // case this PasswordStoreX will act the same as PasswordStoreDefault. | 56 // case this PasswordStoreX will act the same as PasswordStoreDefault. |
54 PasswordStoreX(LoginDatabase* login_db, | 57 PasswordStoreX(LoginDatabase* login_db, |
55 Profile* profile, | 58 Profile* profile, |
56 NativeBackend* backend); | 59 NativeBackend* backend); |
57 | 60 |
58 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | 61 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) |
59 // Registers the pref setting used for the methods below. | 62 // Registers the pref setting used for the methods below. |
60 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 63 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
61 | 64 |
62 // Returns true if passwords have been tagged with the local profile id. | 65 // Returns true if passwords have been tagged with the local profile id. |
63 static bool PasswordsUseLocalProfileId(PrefService* prefs); | 66 static bool PasswordsUseLocalProfileId(PrefService* prefs); |
64 | 67 |
65 // Sets the persistent bit indicating that passwords have been tagged with the | 68 // Sets the persistent bit indicating that passwords have been tagged with the |
66 // local profile id. This cannot be unset; passwords get migrated only once. | 69 // local profile id. This cannot be unset; passwords get migrated only once. |
67 // The caller promises that |prefs| will not be deleted any time soon. | 70 // The caller promises that |prefs| will not be deleted any time soon. |
68 static void SetPasswordsUseLocalProfileId(PrefService* prefs); | 71 static void SetPasswordsUseLocalProfileId(PrefService* prefs); |
69 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | 72 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) |
70 | 73 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // Whether we should allow falling back to the default store. If there is | 120 // Whether we should allow falling back to the default store. If there is |
118 // nothing to migrate, then the first attempt to use the native store will | 121 // nothing to migrate, then the first attempt to use the native store will |
119 // be the first time we try to use it and we should allow falling back. If | 122 // be the first time we try to use it and we should allow falling back. If |
120 // we have migrated successfully, then we do not allow falling back. | 123 // we have migrated successfully, then we do not allow falling back. |
121 bool allow_fallback_; | 124 bool allow_fallback_; |
122 | 125 |
123 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); | 126 DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); |
124 }; | 127 }; |
125 | 128 |
126 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ | 129 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_ |
OLD | NEW |