| 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_FORM_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "chrome/browser/password_manager/password_store.h" |
| 14 #include "chrome/browser/password_manager/password_store_consumer.h" | 15 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 15 #include "components/autofill/core/common/password_form.h" | 16 #include "components/autofill/core/common/password_form.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 class WebContents; | 19 class WebContents; |
| 19 } // namespace content | 20 } // namespace content |
| 20 | 21 |
| 21 class PasswordManager; | 22 class PasswordManager; |
| 22 class PasswordStore; | |
| 23 class Profile; | 23 class Profile; |
| 24 | 24 |
| 25 // Per-password-form-{on-page, dialog} class responsible for interactions | 25 // Per-password-form-{on-page, dialog} class responsible for interactions |
| 26 // between a given form, the per-tab PasswordManager, and the PasswordStore. | 26 // between a given form, the per-tab PasswordManager, and the PasswordStore. |
| 27 class PasswordFormManager : public PasswordStoreConsumer { | 27 class PasswordFormManager : public PasswordStoreConsumer { |
| 28 public: | 28 public: |
| 29 // profile contains the link to the PasswordStore and whether we're off | 29 // profile contains the link to the PasswordStore and whether we're off |
| 30 // the record | 30 // the record |
| 31 // password_manager owns this object | 31 // password_manager owns this object |
| 32 // form_on_page is the form that may be submitted and could need login data. | 32 // form_on_page is the form that may be submitted and could need login data. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 ALLOW_OTHER_POSSIBLE_USERNAMES, | 48 ALLOW_OTHER_POSSIBLE_USERNAMES, |
| 49 IGNORE_OTHER_POSSIBLE_USERNAMES | 49 IGNORE_OTHER_POSSIBLE_USERNAMES |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // Compare basic data of observed_form_ with argument. Only check the action | 52 // Compare basic data of observed_form_ with argument. Only check the action |
| 53 // URL when action match is required. | 53 // URL when action match is required. |
| 54 bool DoesManage(const autofill::PasswordForm& form, | 54 bool DoesManage(const autofill::PasswordForm& form, |
| 55 ActionMatch action_match) const; | 55 ActionMatch action_match) const; |
| 56 | 56 |
| 57 // Retrieves potential matching logins from the database. | 57 // Retrieves potential matching logins from the database. |
| 58 void FetchMatchingLoginsFromPasswordStore(); | 58 // |prompt_policy| indicates whether it's permissible to prompt the user to |
| 59 // authorize access to locked passwords. This argument is only used on |
| 60 // platforms that support prompting the user for access (such as Mac OS). |
| 61 void FetchMatchingLoginsFromPasswordStore( |
| 62 PasswordStore::AuthorizationPromptPolicy prompt_policy); |
| 59 | 63 |
| 60 // Simple state-check to verify whether this object as received a callback | 64 // Simple state-check to verify whether this object as received a callback |
| 61 // from the PasswordStore and completed its matching phase. Note that the | 65 // from the PasswordStore and completed its matching phase. Note that the |
| 62 // callback in question occurs on the same (and only) main thread from which | 66 // callback in question occurs on the same (and only) main thread from which |
| 63 // instances of this class are ever used, but it is required since it is | 67 // instances of this class are ever used, but it is required since it is |
| 64 // conceivable that a user (or ui test) could attempt to submit a login | 68 // conceivable that a user (or ui test) could attempt to submit a login |
| 65 // prompt before the callback has occured, which would InvokeLater a call to | 69 // prompt before the callback has occured, which would InvokeLater a call to |
| 66 // PasswordManager::ProvisionallySave, which would interact with this object | 70 // PasswordManager::ProvisionallySave, which would interact with this object |
| 67 // before the db has had time to answer with matching password entries. | 71 // before the db has had time to answer with matching password entries. |
| 68 // This is intended to be a one-time check; if the return value is false the | 72 // This is intended to be a one-time check; if the return value is false the |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 // These three fields record the "ActionsTaken" by the browser and | 311 // These three fields record the "ActionsTaken" by the browser and |
| 308 // the user with this form, and the result. They are combined and | 312 // the user with this form, and the result. They are combined and |
| 309 // recorded in UMA when the manager is destroyed. | 313 // recorded in UMA when the manager is destroyed. |
| 310 ManagerAction manager_action_; | 314 ManagerAction manager_action_; |
| 311 UserAction user_action_; | 315 UserAction user_action_; |
| 312 SubmitResult submit_result_; | 316 SubmitResult submit_result_; |
| 313 | 317 |
| 314 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 318 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| 315 }; | 319 }; |
| 316 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 320 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| OLD | NEW |