| OLD | NEW |
| 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 Loading... |
| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 bool datalist_only, | 568 bool datalist_only, |
| 569 bool show_full_suggestion_list, | 569 bool show_full_suggestion_list, |
| 570 bool show_password_suggestions_only) { | 570 bool show_password_suggestions_only) { |
| 571 if (!element.isEnabled() || element.isReadOnly()) | 571 if (!element.isEnabled() || element.isReadOnly()) |
| 572 return; | 572 return; |
| 573 if (!datalist_only && !element.suggestedValue().isEmpty()) | 573 if (!datalist_only && !element.suggestedValue().isEmpty()) |
| 574 return; | 574 return; |
| 575 | 575 |
| 576 const WebInputElement* input_element = toWebInputElement(&element); | 576 const WebInputElement* input_element = toWebInputElement(&element); |
| 577 if (input_element) { | 577 if (input_element) { |
| 578 if (!input_element->isTextField() || input_element->isPasswordField()) | 578 if (!input_element->isTextField()) |
| 579 return; | 579 return; |
| 580 if (!datalist_only && !input_element->suggestedValue().isEmpty()) | 580 if (!datalist_only && !input_element->suggestedValue().isEmpty()) |
| 581 return; | 581 return; |
| 582 } else { | 582 } else { |
| 583 DCHECK(IsTextAreaElement(element)); | 583 DCHECK(IsTextAreaElement(element)); |
| 584 if (!element.toConst<WebTextAreaElement>().suggestedValue().isEmpty()) | 584 if (!element.toConst<WebTextAreaElement>().suggestedValue().isEmpty()) |
| 585 return; | 585 return; |
| 586 } | 586 } |
| 587 | 587 |
| 588 // Don't attempt to autofill with values that are too large or if filling | 588 // Don't attempt to autofill with values that are too large or if filling |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 ProcessForms(*frame); | 745 ProcessForms(*frame); |
| 746 password_autofill_agent_->OnDynamicFormsSeen(frame); | 746 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 747 if (password_generation_agent_) | 747 if (password_generation_agent_) |
| 748 password_generation_agent_->OnDynamicFormsSeen(frame); | 748 password_generation_agent_->OnDynamicFormsSeen(frame); |
| 749 return; | 749 return; |
| 750 } | 750 } |
| 751 } | 751 } |
| 752 } | 752 } |
| 753 | 753 |
| 754 } // namespace autofill | 754 } // namespace autofill |
| OLD | NEW |