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

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

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698