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

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

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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
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/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
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
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
OLDNEW
« no previous file with comments | « chrome/common/favicon/fallback_icon_url_parser.cc ('k') | components/autofill/core/browser/validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698