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

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: Fix compile error on Chrome OS. Created 6 years, 8 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 WebInputElement* input_element = toWebInputElement(&element_); 477 WebInputElement* input_element = toWebInputElement(&element_);
478 if (input_element) 478 if (input_element)
479 PreviewFieldWithValue(value, input_element); 479 PreviewFieldWithValue(value, input_element);
480 } 480 }
481 481
482 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { 482 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) {
483 AcceptDataListSuggestion(value); 483 AcceptDataListSuggestion(value);
484 } 484 }
485 485
486 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( 486 void AutofillAgent::OnAcceptPasswordAutofillSuggestion(
487 const base::string16& username) { 487 const base::string16& username,
488 // We need to make sure this is handled here because the browser process 488 const base::string16& password) {
489 // skipped it handling because it believed it would be handled here. If it 489 bool handled = password_autofill_agent_->AcceptSuggestion(
490 // isn't handled here then the browser logic needs to be updated.
491 bool handled = password_autofill_agent_->DidAcceptAutofillSuggestion(
492 element_, 490 element_,
493 username); 491 username,
492 password);
494 DCHECK(handled); 493 DCHECK(handled);
495 } 494 }
496 495
497 void AutofillAgent::OnRequestAutocompleteResult( 496 void AutofillAgent::OnRequestAutocompleteResult(
498 WebFormElement::AutocompleteResult result, 497 WebFormElement::AutocompleteResult result,
499 const FormData& form_data) { 498 const FormData& form_data) {
500 if (in_flight_request_form_.isNull()) 499 if (in_flight_request_form_.isNull())
501 return; 500 return;
502 501
503 if (result == WebFormElement::AutocompleteResultSuccess) { 502 if (result == WebFormElement::AutocompleteResultSuccess) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 // Only monitors dynamic forms created in the top frame. Dynamic forms 660 // Only monitors dynamic forms created in the top frame. Dynamic forms
662 // inserted in iframes are not captured yet. 661 // inserted in iframes are not captured yet.
663 if (frame && !frame->parent()) { 662 if (frame && !frame->parent()) {
664 password_autofill_agent_->OnDynamicFormsSeen(frame); 663 password_autofill_agent_->OnDynamicFormsSeen(frame);
665 return; 664 return;
666 } 665 }
667 } 666 }
668 } 667 }
669 668
670 } // namespace autofill 669 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698