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

Side by Side Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 184103016: Autofill: Refactoring to support fetching password after a username is selected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address gcasto's comments. Created 6 years, 9 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
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 #include "components/autofill/content/renderer/autofill_agent.h" 5 #include "components/autofill/content/renderer/autofill_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 435
436 void AutofillAgent::OnSetNodeText(const base::string16& value) { 436 void AutofillAgent::OnSetNodeText(const base::string16& value) {
437 SetNodeText(value, &element_); 437 SetNodeText(value, &element_);
438 } 438 }
439 439
440 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { 440 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) {
441 AcceptDataListSuggestion(value); 441 AcceptDataListSuggestion(value);
442 } 442 }
443 443
444 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( 444 void AutofillAgent::OnAcceptPasswordAutofillSuggestion(
445 const base::string16& username) { 445 const base::string16& username,
446 // We need to make sure this is handled here because the browser process 446 const base::string16& password) {
447 // skipped it handling because it believed it would be handled here. If it 447 bool handled = password_autofill_agent_->AcceptAutofillSuggestionWithPassword(
448 // isn't handled here then the browser logic needs to be updated.
449 bool handled = password_autofill_agent_->DidAcceptAutofillSuggestion(
450 element_, 448 element_,
451 username); 449 username,
450 password);
452 DCHECK(handled); 451 DCHECK(handled);
453 } 452 }
454 453
455 void AutofillAgent::OnRequestAutocompleteResult( 454 void AutofillAgent::OnRequestAutocompleteResult(
456 WebFormElement::AutocompleteResult result, const FormData& form_data) { 455 WebFormElement::AutocompleteResult result, const FormData& form_data) {
457 if (in_flight_request_form_.isNull()) 456 if (in_flight_request_form_.isNull())
458 return; 457 return;
459 458
460 if (result == WebFormElement::AutocompleteResultSuccess) { 459 if (result == WebFormElement::AutocompleteResultSuccess) {
461 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); 460 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 // Only monitors dynamic forms created in the top frame. Dynamic forms 591 // Only monitors dynamic forms created in the top frame. Dynamic forms
593 // inserted in iframes are not captured yet. 592 // inserted in iframes are not captured yet.
594 if (frame && !frame->parent()) { 593 if (frame && !frame->parent()) {
595 password_autofill_agent_->OnDynamicFormsSeen(frame); 594 password_autofill_agent_->OnDynamicFormsSeen(frame);
596 return; 595 return;
597 } 596 }
598 } 597 }
599 } 598 }
600 599
601 } // namespace autofill 600 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698