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/location.h" | 10 #include "base/location.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 std::vector<base::string16> parts; | 489 std::vector<base::string16> parts; |
490 | 490 |
491 base::SplitStringDontTrim( | 491 base::SplitStringDontTrim( |
492 base::StringPiece16(input_element->editingValue()), ',', &parts); | 492 base::StringPiece16(input_element->editingValue()), ',', &parts); |
493 if (parts.size() == 0) | 493 if (parts.size() == 0) |
494 parts.push_back(base::string16()); | 494 parts.push_back(base::string16()); |
495 | 495 |
496 base::string16 last_part = parts.back(); | 496 base::string16 last_part = parts.back(); |
497 // We want to keep just the leading whitespace. | 497 // We want to keep just the leading whitespace. |
498 for (size_t i = 0; i < last_part.size(); ++i) { | 498 for (size_t i = 0; i < last_part.size(); ++i) { |
499 if (!IsWhitespace(last_part[i])) { | 499 if (!base::IsUnicodeWhitespace(last_part[i])) { |
500 last_part = last_part.substr(0, i); | 500 last_part = last_part.substr(0, i); |
501 break; | 501 break; |
502 } | 502 } |
503 } | 503 } |
504 last_part.append(suggested_value); | 504 last_part.append(suggested_value); |
505 parts[parts.size() - 1] = last_part; | 505 parts[parts.size() - 1] = last_part; |
506 | 506 |
507 new_value = JoinString(parts, ','); | 507 new_value = JoinString(parts, ','); |
508 } | 508 } |
509 FillFieldWithValue(new_value, input_element); | 509 FillFieldWithValue(new_value, input_element); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 805 |
806 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 806 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
807 // No-op. Don't delete |this|. | 807 // No-op. Don't delete |this|. |
808 } | 808 } |
809 | 809 |
810 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 810 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
811 agent_->FocusChangeComplete(); | 811 agent_->FocusChangeComplete(); |
812 } | 812 } |
813 | 813 |
814 } // namespace autofill | 814 } // namespace autofill |
OLD | NEW |