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

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

Issue 492043003: Fill on account select in the password manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT Created 6 years, 1 month 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return; 228 return;
229 229
230 WebElement web_element = node.toConst<WebElement>(); 230 WebElement web_element = node.toConst<WebElement>();
231 231
232 if (!web_element.document().frame()) 232 if (!web_element.document().frame())
233 return; 233 return;
234 234
235 const WebInputElement* element = toWebInputElement(&web_element); 235 const WebInputElement* element = toWebInputElement(&web_element);
236 236
237 if (!element || !element->isEnabled() || element->isReadOnly() || 237 if (!element || !element->isEnabled() || element->isReadOnly() ||
238 !element->isTextField() || element->isPasswordField()) 238 !element->isTextField())
239 return; 239 return;
240 240
241 element_ = *element; 241 element_ = *element;
242 } 242 }
243 243
244 void AutofillAgent::OrientationChangeEvent() { 244 void AutofillAgent::OrientationChangeEvent() {
245 HidePopup(); 245 HidePopup();
246 } 246 }
247 247
248 void AutofillAgent::Resized() { 248 void AutofillAgent::Resized() {
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 bool datalist_only, 559 bool datalist_only,
560 bool show_full_suggestion_list, 560 bool show_full_suggestion_list,
561 bool show_password_suggestions_only) { 561 bool show_password_suggestions_only) {
562 if (!element.isEnabled() || element.isReadOnly()) 562 if (!element.isEnabled() || element.isReadOnly())
563 return; 563 return;
564 if (!datalist_only && !element.suggestedValue().isEmpty()) 564 if (!datalist_only && !element.suggestedValue().isEmpty())
565 return; 565 return;
566 566
567 const WebInputElement* input_element = toWebInputElement(&element); 567 const WebInputElement* input_element = toWebInputElement(&element);
568 if (input_element) { 568 if (input_element) {
569 if (!input_element->isTextField() || input_element->isPasswordField()) 569 if (!input_element->isTextField())
570 return; 570 return;
571 if (!datalist_only && !input_element->suggestedValue().isEmpty()) 571 if (!datalist_only && !input_element->suggestedValue().isEmpty())
572 return; 572 return;
573 } else { 573 } else {
574 DCHECK(IsTextAreaElement(element)); 574 DCHECK(IsTextAreaElement(element));
575 if (!element.toConst<WebTextAreaElement>().suggestedValue().isEmpty()) 575 if (!element.toConst<WebTextAreaElement>().suggestedValue().isEmpty())
576 return; 576 return;
577 } 577 }
578 578
579 // Don't attempt to autofill with values that are too large or if filling 579 // Don't attempt to autofill with values that are too large or if filling
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 ProcessForms(*frame); 737 ProcessForms(*frame);
738 password_autofill_agent_->OnDynamicFormsSeen(frame); 738 password_autofill_agent_->OnDynamicFormsSeen(frame);
739 if (password_generation_agent_) 739 if (password_generation_agent_)
740 password_generation_agent_->OnDynamicFormsSeen(frame); 740 password_generation_agent_->OnDynamicFormsSeen(frame);
741 return; 741 return;
742 } 742 }
743 } 743 }
744 } 744 }
745 745
746 } // namespace autofill 746 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698