| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // We want to keep just the leading whitespace. | 496 // We want to keep just the leading whitespace. |
| 497 for (size_t i = 0; i < last_part.size(); ++i) { | 497 for (size_t i = 0; i < last_part.size(); ++i) { |
| 498 if (!base::IsUnicodeWhitespace(last_part[i])) { | 498 if (!base::IsUnicodeWhitespace(last_part[i])) { |
| 499 last_part = last_part.substr(0, i); | 499 last_part = last_part.substr(0, i); |
| 500 break; | 500 break; |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 last_part.append(suggested_value); | 503 last_part.append(suggested_value); |
| 504 parts[parts.size() - 1] = last_part; | 504 parts[parts.size() - 1] = last_part; |
| 505 | 505 |
| 506 new_value = base::JoinString(parts, base::ASCIIToUTF16(",")); | 506 new_value = JoinString(parts, ','); |
| 507 } | 507 } |
| 508 FillFieldWithValue(new_value, input_element); | 508 FillFieldWithValue(new_value, input_element); |
| 509 } | 509 } |
| 510 | 510 |
| 511 void AutofillAgent::OnFieldTypePredictionsAvailable( | 511 void AutofillAgent::OnFieldTypePredictionsAvailable( |
| 512 const std::vector<FormDataPredictions>& forms) { | 512 const std::vector<FormDataPredictions>& forms) { |
| 513 for (size_t i = 0; i < forms.size(); ++i) { | 513 for (size_t i = 0; i < forms.size(); ++i) { |
| 514 form_cache_.ShowPredictions(forms[i]); | 514 form_cache_.ShowPredictions(forms[i]); |
| 515 } | 515 } |
| 516 } | 516 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 | 803 |
| 804 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 804 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
| 805 // No-op. Don't delete |this|. | 805 // No-op. Don't delete |this|. |
| 806 } | 806 } |
| 807 | 807 |
| 808 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 808 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
| 809 agent_->FocusChangeComplete(); | 809 agent_->FocusChangeComplete(); |
| 810 } | 810 } |
| 811 | 811 |
| 812 } // namespace autofill | 812 } // namespace autofill |
| OLD | NEW |