Index: chrome/browser/password_manager/password_store_gnome.h |
=================================================================== |
--- chrome/browser/password_manager/password_store_gnome.h (revision 48891) |
+++ chrome/browser/password_manager/password_store_gnome.h (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -9,32 +9,60 @@ |
#include <gnome-keyring.h> |
} |
+#include <vector> |
+ |
#include "base/lock.h" |
+#include "chrome/browser/password_manager/login_database.h" |
#include "chrome/browser/password_manager/password_store.h" |
+#include "chrome/browser/profile.h" |
+#include "chrome/browser/webdata/web_data_service.h" |
class Profile; |
class Task; |
-// PasswordStore implementation using Gnome Keyring. |
+// PasswordStore implementation using GNOME Keyring. |
class PasswordStoreGnome : public PasswordStore { |
public: |
- PasswordStoreGnome(); |
+ PasswordStoreGnome(LoginDatabase* login_db, |
+ Profile* profile, |
+ WebDataService* web_data_service); |
virtual bool Init(); |
private: |
virtual ~PasswordStoreGnome(); |
- void AddLoginImpl(const PasswordForm& form); |
- void UpdateLoginImpl(const PasswordForm& form); |
- void RemoveLoginImpl(const PasswordForm& form); |
- void GetLoginsImpl(GetLoginsRequest* request); |
+ // Implements PasswordStore interface. |
+ virtual void AddLoginImpl(const webkit_glue::PasswordForm& form); |
+ virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form); |
+ virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form); |
+ virtual void RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin, |
+ const base::Time& delete_end); |
+ virtual void GetLoginsImpl(GetLoginsRequest* request, |
+ const webkit_glue::PasswordForm& form); |
+ virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request); |
+ virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request); |
+ virtual bool FillAutofillableLogins( |
+ std::vector<webkit_glue::PasswordForm*>* forms); |
+ virtual bool FillBlacklistLogins( |
+ std::vector<webkit_glue::PasswordForm*>* forms); |
+ // Helper for AddLoginImpl() and UpdateLoginImpl() with a success status. |
+ bool AddLoginHelper(const webkit_glue::PasswordForm& form, |
+ const base::Time& date_created); |
+ |
+ // Helper for FillAutofillableLogins() and FillBlacklistLogins(). |
+ bool FillSomeLogins(bool autofillable, |
+ std::vector<webkit_glue::PasswordForm*>* forms); |
+ |
+ // Parse all the results from the given GList into a |
+ // vector<PasswordForm*>, and free the GList. PasswordForms are |
+ // allocated on the heap, and should be deleted by the consumer. |
+ void FillFormVector(GList* found, |
+ std::vector<webkit_glue::PasswordForm*>* forms); |
+ |
static const GnomeKeyringPasswordSchema kGnomeSchema; |
- // Mutex for all interactions with Gnome Keyring. |
- Lock gnome_keyring_lock_; |
- |
DISALLOW_COPY_AND_ASSIGN(PasswordStoreGnome); |
}; |