| 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_PASSWORD_STORE_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 namespace passwords_helper { | 33 namespace passwords_helper { |
| 34 void AddLogin(PasswordStore* store, const content::PasswordForm& form); | 34 void AddLogin(PasswordStore* store, const content::PasswordForm& form); |
| 35 void RemoveLogin(PasswordStore* store, const content::PasswordForm& form); | 35 void RemoveLogin(PasswordStore* store, const content::PasswordForm& form); |
| 36 void UpdateLogin(PasswordStore* store, const content::PasswordForm& form); | 36 void UpdateLogin(PasswordStore* store, const content::PasswordForm& form); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // Interface for storing form passwords in a platform-specific secure way. | 39 // Interface for storing form passwords in a platform-specific secure way. |
| 40 // The login request/manipulation API is not threadsafe and must be used | 40 // The login request/manipulation API is not threadsafe and must be used |
| 41 // from the UI thread. | 41 // from the UI thread. |
| 42 class PasswordStore | 42 class PasswordStore |
| 43 : public RefcountedProfileKeyedService, | 43 : public RefcountedBrowserContextKeyedService, |
| 44 public CancelableRequestProvider { | 44 public CancelableRequestProvider { |
| 45 public: | 45 public: |
| 46 typedef base::Callback< | 46 typedef base::Callback< |
| 47 void(Handle, const std::vector<content::PasswordForm*>&)> | 47 void(Handle, const std::vector<content::PasswordForm*>&)> |
| 48 GetLoginsCallback; | 48 GetLoginsCallback; |
| 49 | 49 |
| 50 // PasswordForm vector elements are meant to be owned by the | 50 // PasswordForm vector elements are meant to be owned by the |
| 51 // PasswordStoreConsumer. However, if the request is canceled after the | 51 // PasswordStoreConsumer. However, if the request is canceled after the |
| 52 // allocation, then the request must take care of the deletion. | 52 // allocation, then the request must take care of the deletion. |
| 53 class GetLoginsRequest | 53 class GetLoginsRequest |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // may have been changed. | 226 // may have been changed. |
| 227 void NotifyLoginsChanged(); | 227 void NotifyLoginsChanged(); |
| 228 | 228 |
| 229 // The observers. | 229 // The observers. |
| 230 ObserverList<Observer> observers_; | 230 ObserverList<Observer> observers_; |
| 231 | 231 |
| 232 DISALLOW_COPY_AND_ASSIGN(PasswordStore); | 232 DISALLOW_COPY_AND_ASSIGN(PasswordStore); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ | 235 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ |
| OLD | NEW |