| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 if (options.isNull()) | 70 if (options.isNull()) |
| 71 return; | 71 return; |
| 72 | 72 |
| 73 base::string16 prefix; | 73 base::string16 prefix; |
| 74 if (!ignore_current_value) { | 74 if (!ignore_current_value) { |
| 75 prefix = element.editingValue(); | 75 prefix = element.editingValue(); |
| 76 if (element.isMultiple() && | 76 if (element.isMultiple() && |
| 77 element.formControlType() == WebString::fromUTF8("email")) { | 77 element.formControlType() == WebString::fromUTF8("email")) { |
| 78 std::vector<base::string16> parts; | 78 std::vector<base::string16> parts; |
| 79 base::SplitStringDontTrim(prefix, ',', &parts); | 79 base::SplitStringDontTrim(prefix, ',', &parts); |
| 80 if (parts.size() > 0) | 80 if (parts.size() > 0) { |
| 81 TrimWhitespace(parts[parts.size() - 1], TRIM_LEADING, &prefix); | 81 base::TrimWhitespace(parts[parts.size() - 1], base::TRIM_LEADING, |
| 82 &prefix); |
| 83 } |
| 82 } | 84 } |
| 83 } | 85 } |
| 84 for (WebOptionElement option = options.firstItem().to<WebOptionElement>(); | 86 for (WebOptionElement option = options.firstItem().to<WebOptionElement>(); |
| 85 !option.isNull(); option = options.nextItem().to<WebOptionElement>()) { | 87 !option.isNull(); option = options.nextItem().to<WebOptionElement>()) { |
| 86 if (!StartsWith(option.value(), prefix, false) || | 88 if (!StartsWith(option.value(), prefix, false) || |
| 87 option.value() == prefix || | 89 option.value() == prefix || |
| 88 !element.isValidValue(option.value())) | 90 !element.isValidValue(option.value())) |
| 89 continue; | 91 continue; |
| 90 | 92 |
| 91 values->push_back(option.value()); | 93 values->push_back(option.value()); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 // Only monitors dynamic forms created in the top frame. Dynamic forms | 637 // Only monitors dynamic forms created in the top frame. Dynamic forms |
| 636 // inserted in iframes are not captured yet. | 638 // inserted in iframes are not captured yet. |
| 637 if (!frame->parent()) { | 639 if (!frame->parent()) { |
| 638 password_autofill_agent_->OnDynamicFormsSeen(frame); | 640 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 639 return; | 641 return; |
| 640 } | 642 } |
| 641 } | 643 } |
| 642 } | 644 } |
| 643 | 645 |
| 644 } // namespace autofill | 646 } // namespace autofill |
| OLD | NEW |