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