Chromium Code Reviews| Index: chrome/browser/password_manager/native_backend_kwallet_x.h |
| diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.h b/chrome/browser/password_manager/native_backend_kwallet_x.h |
| index 6e98a415713bd69946204bfabc58dedb86a33c97..6f4cc3d2e048067e7736e5206db7b3eef4337693 100644 |
| --- a/chrome/browser/password_manager/native_backend_kwallet_x.h |
| +++ b/chrome/browser/password_manager/native_backend_kwallet_x.h |
| @@ -67,10 +67,10 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { |
| // Internally used by Init(), but also for testing to provide a mock bus. |
| bool InitWithBus(scoped_refptr<dbus::Bus> optional_bus); |
| - // Deserializes a list of PasswordForms from the wallet. |
| - static void DeserializeValue(const std::string& signon_realm, |
| - const Pickle& pickle, |
| - ScopedVector<autofill::PasswordForm>* forms); |
| + // Deserializes a list of PasswordForms from the wallet. Protected for tests. |
|
engedy
2015/02/25 15:17:48
Nit: What does "protected for tests" mean?
vabr (Chromium)
2015/03/09 10:56:18
It meant: "Protected, instead of private, so that
engedy
2015/03/09 13:33:17
Acknowledged.
|
| + static ScopedVector<autofill::PasswordForm> DeserializeValue( |
| + const std::string& signon_realm, |
| + const Pickle& pickle); |
| private: |
| enum InitResult { |
| @@ -84,6 +84,8 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { |
| SYNC_TIMESTAMP, |
| }; |
| + enum class BlacklistOptions { AUTOFILLABLE, BLACKLISTED }; |
| + |
| // Initialization. |
| bool StartKWalletd(); |
| InitResult InitWallet(); |
| @@ -91,17 +93,20 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { |
| base::WaitableEvent* event, |
| bool* success); |
| - // Reads PasswordForms from the wallet that match the given signon_realm. |
| + // Overwrites |forms| with all credentials matching |signon_realm|. On success |
| + // returns true, on failure returns false and erases |forms|. |
| bool GetLoginsList(const std::string& signon_realm, |
| int wallet_handle, |
| ScopedVector<autofill::PasswordForm>* forms); |
| - // Reads PasswordForms from the wallet with the given autofillability state. |
| - bool GetLoginsList(bool autofillable, |
| + // Overwrites |forms| with all credentials matching |options|. On success |
| + // returns true, on failure returns false and erases |forms|. |
| + bool GetLoginsList(BlacklistOptions options, |
| int wallet_handle, |
| ScopedVector<autofill::PasswordForm>* forms); |
| - // Helper for some of the above GetLoginsList() methods. |
| + // Overwrites |forms| with all stored credentials. On success returns true, on |
| + // failure returns false and erases |forms|. |
| bool GetAllLogins(int wallet_handle, |
| ScopedVector<autofill::PasswordForm>* forms); |
| @@ -123,27 +128,6 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { |
| // Returns kInvalidWalletHandle on error. |
| int WalletHandle(); |
| - // Serializes a list of PasswordForms to be stored in the wallet. |
| - static void SerializeValue(const std::vector<autofill::PasswordForm*>& forms, |
| - Pickle* pickle); |
| - |
| - // Deserializes a list of PasswordForms from the wallet. |
| - // |size_32| controls reading the size field within the pickle as 32 bits. |
| - // We used to use Pickle::WriteSize() to write the number of password forms, |
| - // but that has a different size on 32- and 64-bit systems. So, now we always |
| - // write a 64-bit quantity, but we support trying to read it as either size |
| - // when reading old pickles that fail to deserialize using the native size. |
| - static bool DeserializeValueSize(const std::string& signon_realm, |
| - const PickleIterator& iter, |
| - int version, |
| - bool size_32, |
| - bool warn_only, |
| - ScopedVector<autofill::PasswordForm>* forms); |
| - |
| - // In case the fields in the pickle ever change, version them so we can try to |
| - // read old pickles. (Note: do not eat old pickles past the expiration date.) |
| - static const int kPickleVersion = 6; |
| - |
| // Generates a profile-specific folder name based on profile_id_. |
| std::string GetProfileSpecificFolderName() const; |