Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2479)

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.h

Issue 2806002: Linux: refactor GNOME Keyring and KWallet integration to allow migration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/native_backend_gnome_x.h
===================================================================
--- chrome/browser/password_manager/native_backend_gnome_x.h (revision 49824)
+++ chrome/browser/password_manager/native_backend_gnome_x.h (working copy)
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_
-#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_
+#ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
+#define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
extern "C" {
#include <gnome-keyring.h>
@@ -11,59 +11,52 @@
#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"
+#include "base/basictypes.h"
+#include "base/time.h"
+#include "chrome/browser/password_manager/password_store_x.h"
-class Profile;
-class Task;
+namespace webkit_glue {
+struct PasswordForm;
+}
-// PasswordStore implementation using GNOME Keyring.
-class PasswordStoreGnome : public PasswordStore {
+// NativeBackend implementation using GNOME Keyring.
+class NativeBackendGnome : public PasswordStoreX::NativeBackend {
public:
- PasswordStoreGnome(LoginDatabase* login_db,
- Profile* profile,
- WebDataService* web_data_service);
+ NativeBackendGnome();
+ virtual ~NativeBackendGnome();
+
virtual bool Init();
+ // Implements NativeBackend interface.
+ virtual bool AddLogin(const webkit_glue::PasswordForm& form);
+ virtual bool UpdateLogin(const webkit_glue::PasswordForm& form);
+ virtual bool RemoveLogin(const webkit_glue::PasswordForm& form);
+ virtual bool RemoveLoginsCreatedBetween(const base::Time& delete_begin,
+ const base::Time& delete_end);
+ virtual bool GetLogins(const webkit_glue::PasswordForm& form,
+ PasswordFormList* forms);
+ virtual bool GetLoginsCreatedBetween(const base::Time& get_begin,
+ const base::Time& get_end,
+ PasswordFormList* forms);
+ virtual bool GetAutofillableLogins(PasswordFormList* forms);
+ virtual bool GetBlacklistLogins(PasswordFormList* forms);
+
private:
- virtual ~PasswordStoreGnome();
+ // Reads PasswordForms from the keyring with the given autofillability state.
+ bool GetLoginsList(PasswordFormList* forms, bool autofillable);
- // 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 GetLoginsCreatedBetween().
+ bool GetAllLogins(PasswordFormList* forms);
- // Helper for AddLoginImpl() and UpdateLoginImpl() with a success status.
- bool AddLoginHelper(const webkit_glue::PasswordForm& form,
- const base::Time& date_created);
+ // Parse all the results from the given GList into a PasswordFormList, and
+ // free the GList. PasswordForms are allocated on the heap, and should be
+ // deleted by the consumer.
+ void ConvertFormList(GList* found, PasswordFormList* forms);
- // 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;
- DISALLOW_COPY_AND_ASSIGN(PasswordStoreGnome);
+ DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome);
};
-#endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_
+#endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698