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 "content/public/common/password_form.h" | 16 #include "content/public/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 content::PasswordForm& form, | 54 bool DoesManage(const content::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 void FetchMatchingLoginsFromPasswordStore( |
| 59 PasswordStore::AuthorizationPromptPermission permission_to_prompt); |
59 | 60 |
60 // Simple state-check to verify whether this object as received a callback | 61 // Simple state-check to verify whether this object as received a callback |
61 // from the PasswordStore and completed its matching phase. Note that the | 62 // 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 | 63 // 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 | 64 // 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 | 65 // 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 | 66 // prompt before the callback has occured, which would InvokeLater a call to |
66 // PasswordManager::ProvisionallySave, which would interact with this object | 67 // PasswordManager::ProvisionallySave, which would interact with this object |
67 // before the db has had time to answer with matching password entries. | 68 // 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 | 69 // This is intended to be a one-time check; if the return value is false the |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // These three fields record the "ActionsTaken" by the browser and | 289 // These three fields record the "ActionsTaken" by the browser and |
289 // the user with this form, and the result. They are combined and | 290 // the user with this form, and the result. They are combined and |
290 // recorded in UMA when the manager is destroyed. | 291 // recorded in UMA when the manager is destroyed. |
291 ManagerAction manager_action_; | 292 ManagerAction manager_action_; |
292 UserAction user_action_; | 293 UserAction user_action_; |
293 SubmitResult submit_result_; | 294 SubmitResult submit_result_; |
294 | 295 |
295 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 296 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
296 }; | 297 }; |
297 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 298 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
OLD | NEW |