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

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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 void AutofillAgent::OnSetNodeText(const base::string16& value) { 456 void AutofillAgent::OnSetNodeText(const base::string16& value) {
457 SetNodeText(value, &element_); 457 SetNodeText(value, &element_);
458 } 458 }
459 459
460 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { 460 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) {
461 AcceptDataListSuggestion(value); 461 AcceptDataListSuggestion(value);
462 } 462 }
463 463
464 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( 464 void AutofillAgent::OnAcceptPasswordAutofillSuggestion(
465 const base::string16& username) { 465 const base::string16& username,
466 // We need to make sure this is handled here because the browser process 466 const base::string16& password) {
Patrick Dubroy 2014/03/05 16:31:50 I delete this comment because I'm not sure that it
467 // skipped it handling because it believed it would be handled here. If it 467 bool handled = password_autofill_agent_->AcceptAutofillSuggestionWithPassword(
468 // isn't handled here then the browser logic needs to be updated.
469 bool handled = password_autofill_agent_->DidAcceptAutofillSuggestion(
470 element_, 468 element_,
471 username); 469 username,
470 password);
472 DCHECK(handled); 471 DCHECK(handled);
473 } 472 }
474 473
475 void AutofillAgent::OnRequestAutocompleteResult( 474 void AutofillAgent::OnRequestAutocompleteResult(
476 WebFormElement::AutocompleteResult result, const FormData& form_data) { 475 WebFormElement::AutocompleteResult result, const FormData& form_data) {
477 if (in_flight_request_form_.isNull()) 476 if (in_flight_request_form_.isNull())
478 return; 477 return;
479 478
480 if (result == WebFormElement::AutocompleteResultSuccess) { 479 if (result == WebFormElement::AutocompleteResultSuccess) {
481 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); 480 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 // Only monitors dynamic forms created in the top frame. Dynamic forms 634 // Only monitors dynamic forms created in the top frame. Dynamic forms
636 // inserted in iframes are not captured yet. 635 // inserted in iframes are not captured yet.
637 if (!frame->parent()) { 636 if (!frame->parent()) {
638 password_autofill_agent_->OnDynamicFormsSeen(frame); 637 password_autofill_agent_->OnDynamicFormsSeen(frame);
639 return; 638 return;
640 } 639 }
641 } 640 }
642 } 641 }
643 642
644 } // namespace autofill 643 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698