Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Side by Side Diff: chrome/browser/password_manager/password_form_manager.h

Issue 10701145: Revert 146192 - Revert 146164 - Always query for the latest RenderViewHost from WebContents before … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_form_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 RenderViewHost; 18 class WebContents;
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::RenderViewHost* host, 37 content::WebContents* web_contents,
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
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 // Render view host for sending messages to the corresponding renderer. 245 // Web contents from which we get the RenderViewHost for sending messages to
246 content::RenderViewHost* host_; 246 // the corresponding renderer.
247 content::WebContents* web_contents_;
247 248
248 // These three fields record the "ActionsTaken" by the browser and 249 // These three fields record the "ActionsTaken" by the browser and
249 // the user with this form, and the result. They are combined and 250 // the user with this form, and the result. They are combined and
250 // recorded in UMA when the manager is destroyed. 251 // recorded in UMA when the manager is destroyed.
251 ManagerAction manager_action_; 252 ManagerAction manager_action_;
252 UserAction user_action_; 253 UserAction user_action_;
253 SubmitResult submit_result_; 254 SubmitResult submit_result_;
254 255
255 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); 256 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager);
256 }; 257 };
257 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ 258 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_form_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698