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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_GNOME_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
7 7
8 extern "C" { 8 extern "C" {
9 #include <gnome-keyring.h> 9 #include <gnome-keyring.h>
10 } 10 }
11 11
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/lock.h" 14 #include "base/basictypes.h"
15 #include "chrome/browser/password_manager/login_database.h" 15 #include "base/time.h"
16 #include "chrome/browser/password_manager/password_store.h" 16 #include "chrome/browser/password_manager/password_store_x.h"
17 #include "chrome/browser/profile.h"
18 #include "chrome/browser/webdata/web_data_service.h"
19 17
20 class Profile; 18 namespace webkit_glue {
21 class Task; 19 struct PasswordForm;
20 }
22 21
23 // PasswordStore implementation using GNOME Keyring. 22 // NativeBackend implementation using GNOME Keyring.
24 class PasswordStoreGnome : public PasswordStore { 23 class NativeBackendGnome : public PasswordStoreX::NativeBackend {
25 public: 24 public:
26 PasswordStoreGnome(LoginDatabase* login_db, 25 NativeBackendGnome();
27 Profile* profile, 26
28 WebDataService* web_data_service); 27 virtual ~NativeBackendGnome();
29 28
30 virtual bool Init(); 29 virtual bool Init();
31 30
31 // Implements NativeBackend interface.
32 virtual bool AddLogin(const webkit_glue::PasswordForm& form);
33 virtual bool UpdateLogin(const webkit_glue::PasswordForm& form);
34 virtual bool RemoveLogin(const webkit_glue::PasswordForm& form);
35 virtual bool RemoveLoginsCreatedBetween(const base::Time& delete_begin,
36 const base::Time& delete_end);
37 virtual bool GetLogins(const webkit_glue::PasswordForm& form,
38 PasswordFormList* forms);
39 virtual bool GetLoginsCreatedBetween(const base::Time& get_begin,
40 const base::Time& get_end,
41 PasswordFormList* forms);
42 virtual bool GetAutofillableLogins(PasswordFormList* forms);
43 virtual bool GetBlacklistLogins(PasswordFormList* forms);
44
32 private: 45 private:
33 virtual ~PasswordStoreGnome(); 46 // Reads PasswordForms from the keyring with the given autofillability state.
47 bool GetLoginsList(PasswordFormList* forms, bool autofillable);
34 48
35 // Implements PasswordStore interface. 49 // Helper for GetLoginsCreatedBetween().
36 virtual void AddLoginImpl(const webkit_glue::PasswordForm& form); 50 bool GetAllLogins(PasswordFormList* forms);
37 virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form);
38 virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form);
39 virtual void RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin,
40 const base::Time& delete_end);
41 virtual void GetLoginsImpl(GetLoginsRequest* request,
42 const webkit_glue::PasswordForm& form);
43 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request);
44 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request);
45 virtual bool FillAutofillableLogins(
46 std::vector<webkit_glue::PasswordForm*>* forms);
47 virtual bool FillBlacklistLogins(
48 std::vector<webkit_glue::PasswordForm*>* forms);
49 51
50 // Helper for AddLoginImpl() and UpdateLoginImpl() with a success status. 52 // Parse all the results from the given GList into a PasswordFormList, and
51 bool AddLoginHelper(const webkit_glue::PasswordForm& form, 53 // free the GList. PasswordForms are allocated on the heap, and should be
52 const base::Time& date_created); 54 // deleted by the consumer.
53 55 void ConvertFormList(GList* found, PasswordFormList* forms);
54 // Helper for FillAutofillableLogins() and FillBlacklistLogins().
55 bool FillSomeLogins(bool autofillable,
56 std::vector<webkit_glue::PasswordForm*>* forms);
57
58 // Parse all the results from the given GList into a
59 // vector<PasswordForm*>, and free the GList. PasswordForms are
60 // allocated on the heap, and should be deleted by the consumer.
61 void FillFormVector(GList* found,
62 std::vector<webkit_glue::PasswordForm*>* forms);
63 56
64 static const GnomeKeyringPasswordSchema kGnomeSchema; 57 static const GnomeKeyringPasswordSchema kGnomeSchema;
65 58
66 DISALLOW_COPY_AND_ASSIGN(PasswordStoreGnome); 59 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome);
67 }; 60 };
68 61
69 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_ 62 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
OLDNEW
« 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