| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NATIVE_BACKEND_GNOME_X_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
| 7 | 7 |
| 8 #include <gnome-keyring.h> | 8 #include <gnome-keyring.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 virtual bool Init() OVERRIDE; | 81 virtual bool Init() OVERRIDE; |
| 82 | 82 |
| 83 // Implements NativeBackend interface. | 83 // Implements NativeBackend interface. |
| 84 virtual password_manager::PasswordStoreChangeList AddLogin( | 84 virtual password_manager::PasswordStoreChangeList AddLogin( |
| 85 const autofill::PasswordForm& form) OVERRIDE; | 85 const autofill::PasswordForm& form) OVERRIDE; |
| 86 virtual bool UpdateLogin( | 86 virtual bool UpdateLogin( |
| 87 const autofill::PasswordForm& form, | 87 const autofill::PasswordForm& form, |
| 88 password_manager::PasswordStoreChangeList* changes) OVERRIDE; | 88 password_manager::PasswordStoreChangeList* changes) OVERRIDE; |
| 89 virtual bool RemoveLogin(const autofill::PasswordForm& form) OVERRIDE; | 89 virtual bool RemoveLogin(const autofill::PasswordForm& form) OVERRIDE; |
| 90 virtual bool RemoveLoginsCreatedBetween( | 90 virtual bool RemoveLoginsCreatedBetween(base::Time delete_begin, |
| 91 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; | 91 base::Time delete_end) OVERRIDE; |
| 92 virtual bool RemoveLoginsSyncedBetween( |
| 93 base::Time delete_begin, |
| 94 base::Time delete_end, |
| 95 password_manager::PasswordStoreChangeList* changes) OVERRIDE; |
| 92 virtual bool GetLogins(const autofill::PasswordForm& form, | 96 virtual bool GetLogins(const autofill::PasswordForm& form, |
| 93 PasswordFormList* forms) OVERRIDE; | 97 PasswordFormList* forms) OVERRIDE; |
| 94 virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, | 98 virtual bool GetLoginsCreatedBetween(base::Time get_begin, |
| 95 const base::Time& get_end, | 99 base::Time get_end, |
| 96 PasswordFormList* forms) OVERRIDE; | 100 PasswordFormList* forms) OVERRIDE; |
| 97 virtual bool GetAutofillableLogins(PasswordFormList* forms) OVERRIDE; | 101 virtual bool GetAutofillableLogins(PasswordFormList* forms) OVERRIDE; |
| 98 virtual bool GetBlacklistLogins(PasswordFormList* forms) OVERRIDE; | 102 virtual bool GetBlacklistLogins(PasswordFormList* forms) OVERRIDE; |
| 99 | 103 |
| 100 private: | 104 private: |
| 105 enum TimestampToCompare { |
| 106 CREATION_TIMESTAMP, |
| 107 SYNC_TIMESTAMP, |
| 108 }; |
| 109 |
| 101 // Adds a login form without checking for one to replace first. | 110 // Adds a login form without checking for one to replace first. |
| 102 bool RawAddLogin(const autofill::PasswordForm& form); | 111 bool RawAddLogin(const autofill::PasswordForm& form); |
| 103 | 112 |
| 104 // Reads PasswordForms from the keyring with the given autofillability state. | 113 // Reads PasswordForms from the keyring with the given autofillability state. |
| 105 bool GetLoginsList(PasswordFormList* forms, bool autofillable); | 114 bool GetLoginsList(PasswordFormList* forms, bool autofillable); |
| 106 | 115 |
| 107 // Helper for GetLoginsCreatedBetween(). | 116 // Helper for GetLoginsCreatedBetween(). |
| 108 bool GetAllLogins(PasswordFormList* forms); | 117 bool GetAllLogins(PasswordFormList* forms); |
| 109 | 118 |
| 119 // Retrieves password created/synced in the time interval. Returns |true| if |
| 120 // the operation succeeded. |
| 121 bool GetLoginsBetween(base::Time get_begin, |
| 122 base::Time get_end, |
| 123 TimestampToCompare date_to_compare, |
| 124 PasswordFormList* forms); |
| 125 |
| 126 // Removes password created/synced in the time interval. Returns |true| if the |
| 127 // operation succeeded. |changes| will contain the changes applied. |
| 128 bool RemoveLoginsBetween(base::Time get_begin, |
| 129 base::Time get_end, |
| 130 TimestampToCompare date_to_compare, |
| 131 password_manager::PasswordStoreChangeList* changes); |
| 132 |
| 110 // Generates a profile-specific app string based on profile_id_. | 133 // Generates a profile-specific app string based on profile_id_. |
| 111 std::string GetProfileSpecificAppString() const; | 134 std::string GetProfileSpecificAppString() const; |
| 112 | 135 |
| 113 // The local profile id, used to generate the app string. | 136 // The local profile id, used to generate the app string. |
| 114 const LocalProfileId profile_id_; | 137 const LocalProfileId profile_id_; |
| 115 | 138 |
| 116 // The app string, possibly based on the local profile id. | 139 // The app string, possibly based on the local profile id. |
| 117 std::string app_string_; | 140 std::string app_string_; |
| 118 | 141 |
| 119 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome); | 142 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome); |
| 120 }; | 143 }; |
| 121 | 144 |
| 122 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ | 145 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
| OLD | NEW |