| OLD | NEW |
| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Finds all non-blacklist PasswordForms, and fills the vector. | 133 // Finds all non-blacklist PasswordForms, and fills the vector. |
| 134 virtual bool FillAutofillableLogins( | 134 virtual bool FillAutofillableLogins( |
| 135 std::vector<webkit_glue::PasswordForm*>* forms) = 0; | 135 std::vector<webkit_glue::PasswordForm*>* forms) = 0; |
| 136 // Finds all blacklist PasswordForms, and fills the vector. | 136 // Finds all blacklist PasswordForms, and fills the vector. |
| 137 virtual bool FillBlacklistLogins( | 137 virtual bool FillBlacklistLogins( |
| 138 std::vector<webkit_glue::PasswordForm*>* forms) = 0; | 138 std::vector<webkit_glue::PasswordForm*>* forms) = 0; |
| 139 | 139 |
| 140 // Notifies the consumer that a Get*Logins() request is complete. | 140 // Notifies the consumer that a Get*Logins() request is complete. |
| 141 virtual void NotifyConsumer( | 141 virtual void NotifyConsumer( |
| 142 GetLoginsRequest* request, | 142 GetLoginsRequest* request, |
| 143 const std::vector<webkit_glue::PasswordForm*> forms); | 143 const std::vector<webkit_glue::PasswordForm*>& forms); |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 // Called by NotifyConsumer, but runs in the consumer's thread. Will not | 146 // Called by NotifyConsumer, but runs in the consumer's thread. Will not |
| 147 // call the consumer if the request was canceled. This extra layer is here so | 147 // call the consumer if the request was canceled. This extra layer is here so |
| 148 // that PasswordStoreConsumer doesn't have to be reference counted (we assume | 148 // that PasswordStoreConsumer doesn't have to be reference counted (we assume |
| 149 // consumers will cancel their requests before they are destroyed). | 149 // consumers will cancel their requests before they are destroyed). |
| 150 void NotifyConsumerImpl(PasswordStoreConsumer* consumer, int handle, | 150 void NotifyConsumerImpl(PasswordStoreConsumer* consumer, int handle, |
| 151 const std::vector<webkit_glue::PasswordForm*> forms); | 151 const std::vector<webkit_glue::PasswordForm*>& forms); |
| 152 | 152 |
| 153 // Returns a new request handle tracked in pending_requests_. | 153 // Returns a new request handle tracked in pending_requests_. |
| 154 int GetNewRequestHandle(); | 154 int GetNewRequestHandle(); |
| 155 | 155 |
| 156 // Next handle to return from Get*Logins() to allow callers to track | 156 // Next handle to return from Get*Logins() to allow callers to track |
| 157 // their request. | 157 // their request. |
| 158 int handle_; | 158 int handle_; |
| 159 | 159 |
| 160 // List of pending request handles. Handles are removed from the set when | 160 // List of pending request handles. Handles are removed from the set when |
| 161 // they finish or are canceled. | 161 // they finish or are canceled. |
| 162 std::set<int> pending_requests_; | 162 std::set<int> pending_requests_; |
| 163 | 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(PasswordStore); | 164 DISALLOW_COPY_AND_ASSIGN(PasswordStore); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ | 167 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_H_ |
| OLD | NEW |