| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_ | |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_ | |
| 7 | |
| 8 extern "C" { | |
| 9 #include <gnome-keyring.h> | |
| 10 } | |
| 11 | |
| 12 #include <vector> | |
| 13 | |
| 14 #include "base/lock.h" | |
| 15 #include "chrome/browser/password_manager/login_database.h" | |
| 16 #include "chrome/browser/password_manager/password_store.h" | |
| 17 #include "chrome/browser/profile.h" | |
| 18 #include "chrome/browser/webdata/web_data_service.h" | |
| 19 | |
| 20 class Profile; | |
| 21 class Task; | |
| 22 | |
| 23 // PasswordStore implementation using GNOME Keyring. | |
| 24 class PasswordStoreGnome : public PasswordStore { | |
| 25 public: | |
| 26 PasswordStoreGnome(LoginDatabase* login_db, | |
| 27 Profile* profile, | |
| 28 WebDataService* web_data_service); | |
| 29 | |
| 30 virtual bool Init(); | |
| 31 | |
| 32 private: | |
| 33 virtual ~PasswordStoreGnome(); | |
| 34 | |
| 35 // Implements PasswordStore interface. | |
| 36 virtual void AddLoginImpl(const webkit_glue::PasswordForm& form); | |
| 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 | |
| 50 // Helper for AddLoginImpl() and UpdateLoginImpl() with a success status. | |
| 51 bool AddLoginHelper(const webkit_glue::PasswordForm& form, | |
| 52 const base::Time& date_created); | |
| 53 | |
| 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 | |
| 64 static const GnomeKeyringPasswordSchema kGnomeSchema; | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(PasswordStoreGnome); | |
| 67 }; | |
| 68 | |
| 69 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_GNOME_H_ | |
| OLD | NEW |