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_consumer.h" | 14 #include "chrome/browser/password_manager/password_store_consumer.h" |
15 #include "webkit/forms/password_form.h" | 15 #include "webkit/forms/password_form.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class RenderViewHost; |
19 } // namespace content | 19 } // namespace content |
20 | 20 |
21 class PasswordManager; | 21 class PasswordManager; |
22 class PasswordStore; | 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. |
33 // ssl_valid represents the security of the page containing observed_form, | 33 // ssl_valid represents the security of the page containing observed_form, |
34 // used to filter login results from database. | 34 // used to filter login results from database. |
35 PasswordFormManager(Profile* profile, | 35 PasswordFormManager(Profile* profile, |
36 PasswordManager* password_manager, | 36 PasswordManager* password_manager, |
37 content::WebContents* web_contents, | 37 content::RenderViewHost* host, |
38 const webkit::forms::PasswordForm& observed_form, | 38 const webkit::forms::PasswordForm& observed_form, |
39 bool ssl_valid); | 39 bool ssl_valid); |
40 virtual ~PasswordFormManager(); | 40 virtual ~PasswordFormManager(); |
41 | 41 |
42 // Compare basic data of observed_form_ with argument. | 42 // Compare basic data of observed_form_ with argument. |
43 bool DoesManage(const webkit::forms::PasswordForm& form) const; | 43 bool DoesManage(const webkit::forms::PasswordForm& form) const; |
44 | 44 |
45 // Retrieves potential matching logins from the database. | 45 // Retrieves potential matching logins from the database. |
46 void FetchMatchingLoginsFromPasswordStore(); | 46 void FetchMatchingLoginsFromPasswordStore(); |
47 | 47 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } PasswordFormManagerState; | 235 } PasswordFormManagerState; |
236 | 236 |
237 // State of matching process, used to verify that we don't call methods | 237 // State of matching process, used to verify that we don't call methods |
238 // assuming we've already processed the request for matching logins, | 238 // assuming we've already processed the request for matching logins, |
239 // when we actually haven't. | 239 // when we actually haven't. |
240 PasswordFormManagerState state_; | 240 PasswordFormManagerState state_; |
241 | 241 |
242 // The profile from which we get the PasswordStore. | 242 // The profile from which we get the PasswordStore. |
243 Profile* profile_; | 243 Profile* profile_; |
244 | 244 |
245 // Web contents from which we get the RenderViewHost for sending messages to | 245 // Render view host for sending messages to the corresponding renderer. |
246 // the corresponding renderer. | 246 content::RenderViewHost* host_; |
247 content::WebContents* web_contents_; | |
248 | 247 |
249 // These three fields record the "ActionsTaken" by the browser and | 248 // These three fields record the "ActionsTaken" by the browser and |
250 // the user with this form, and the result. They are combined and | 249 // the user with this form, and the result. They are combined and |
251 // recorded in UMA when the manager is destroyed. | 250 // recorded in UMA when the manager is destroyed. |
252 ManagerAction manager_action_; | 251 ManagerAction manager_action_; |
253 UserAction user_action_; | 252 UserAction user_action_; |
254 SubmitResult submit_result_; | 253 SubmitResult submit_result_; |
255 | 254 |
256 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 255 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
257 }; | 256 }; |
258 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 257 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
OLD | NEW |