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

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.h

Issue 1161023008: Suggest to fill password change forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming and showing password field suggestions rarely Created 5 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
14 #include "components/autofill/core/common/form_data_predictions.h" 15 #include "components/autofill/core/common/form_data_predictions.h"
15 #include "components/autofill/core/common/password_form_field_prediction_map.h" 16 #include "components/autofill/core/common/password_form_field_prediction_map.h"
16 #include "components/autofill/core/common/password_form_fill_data.h" 17 #include "components/autofill/core/common/password_form_fill_data.h"
17 #include "content/public/renderer/render_frame_observer.h" 18 #include "content/public/renderer/render_frame_observer.h"
18 #include "content/public/renderer/render_view_observer.h" 19 #include "content/public/renderer/render_view_observer.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // RenderFrameObserver: 172 // RenderFrameObserver:
172 bool OnMessageReceived(const IPC::Message& message) override; 173 bool OnMessageReceived(const IPC::Message& message) override;
173 void DidFinishDocumentLoad() override; 174 void DidFinishDocumentLoad() override;
174 void DidFinishLoad() override; 175 void DidFinishLoad() override;
175 void FrameDetached() override; 176 void FrameDetached() override;
176 void FrameWillClose() override; 177 void FrameWillClose() override;
177 void DidCommitProvisionalLoad(bool is_new_navigation, 178 void DidCommitProvisionalLoad(bool is_new_navigation,
178 bool is_same_page_navigation) override; 179 bool is_same_page_navigation) override;
179 void WillSendSubmitEvent(const blink::WebFormElement& form) override; 180 void WillSendSubmitEvent(const blink::WebFormElement& form) override;
180 void WillSubmitForm(const blink::WebFormElement& form) override; 181 void WillSubmitForm(const blink::WebFormElement& form) override;
182 void FocusedNodeChanged(const blink::WebNode& node) override;
181 183
182 // Legacy RenderViewObserver: 184 // Legacy RenderViewObserver:
183 void DidStartLoading(); 185 void DidStartLoading();
184 void DidStopLoading(); 186 void DidStopLoading();
185 void LegacyDidStartProvisionalLoad(blink::WebLocalFrame* frame); 187 void LegacyDidStartProvisionalLoad(blink::WebLocalFrame* frame);
186 188
187 // RenderView IPC handlers: 189 // RenderView IPC handlers:
188 void OnFillPasswordForm(int key, const PasswordFormFillData& form_data); 190 void OnFillPasswordForm(int key, const PasswordFormFillData& form_data);
189 void OnSetLoggingState(bool active); 191 void OnSetLoggingState(bool active);
190 void OnAutofillUsernameAndPasswordDataReceived( 192 void OnAutofillUsernameAndPasswordDataReceived(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // Set if the user might be submitting a password form on the current page, 265 // Set if the user might be submitting a password form on the current page,
264 // but the submit may still fail (i.e. doesn't pass JavaScript validation). 266 // but the submit may still fail (i.e. doesn't pass JavaScript validation).
265 scoped_ptr<PasswordForm> provisionally_saved_form_; 267 scoped_ptr<PasswordForm> provisionally_saved_form_;
266 268
267 // Contains the most recent text that user typed or PasswordManager autofilled 269 // Contains the most recent text that user typed or PasswordManager autofilled
268 // in input elements. Used for storing username/password before JavaScript 270 // in input elements. Used for storing username/password before JavaScript
269 // changes them. 271 // changes them.
270 std::map<const blink::WebInputElement, blink::WebString> 272 std::map<const blink::WebInputElement, blink::WebString>
271 nonscript_modified_values_; 273 nonscript_modified_values_;
272 274
275 // Contains all username fields that were in focus. It means that these fields
276 // are visible to the user.
277 std::set<const blink::WebInputElement> had_focus_username_fields_;
278
273 PasswordValueGatekeeper gatekeeper_; 279 PasswordValueGatekeeper gatekeeper_;
274 280
275 // True indicates that user debug information should be logged. 281 // True indicates that user debug information should be logged.
276 bool logging_state_active_; 282 bool logging_state_active_;
277 283
278 // True indicates that the username field was autofilled, false otherwise. 284 // True indicates that the username field was autofilled, false otherwise.
279 bool was_username_autofilled_; 285 bool was_username_autofilled_;
280 // True indicates that the password field was autofilled, false otherwise. 286 // True indicates that the password field was autofilled, false otherwise.
281 bool was_password_autofilled_; 287 bool was_password_autofilled_;
282 288
283 // Records original starting point of username element's selection range 289 // Records original starting point of username element's selection range
284 // before preview. 290 // before preview.
285 int username_selection_start_; 291 int username_selection_start_;
286 292
287 // True indicates that all frames in a page have been rendered. 293 // True indicates that all frames in a page have been rendered.
288 bool did_stop_loading_; 294 bool did_stop_loading_;
289 295
290 // Contains server predictions for username, password and/or new password 296 // Contains server predictions for username, password and/or new password
291 // fields for individual forms. 297 // fields for individual forms.
292 FormsPredictionsMap form_predictions_; 298 FormsPredictionsMap form_predictions_;
293 299
294 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; 300 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
295 301
296 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); 302 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
297 }; 303 };
298 304
299 } // namespace autofill 305 } // namespace autofill
300 306
301 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 307 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698