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

Unified Diff: components/password_manager/core/browser/password_form_manager.cc

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/password_form_manager.cc
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index f6738f8c8622ff88b0c6dfbfbbbc60c8a71cf752..a993ca6561c2d9a5e72aa0c0328ffd8d153ed232 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -110,8 +110,11 @@ PasswordFormManager::PasswordFormManager(
submit_result_(kSubmitResultNotSubmitted),
form_type_(kFormTypeUnspecified) {
drivers_.push_back(driver);
- if (observed_form_.origin.is_valid())
- base::SplitString(observed_form_.origin.path(), '/', &form_path_tokens_);
+ if (observed_form_.origin.is_valid()) {
+ form_path_tokens_ =
+ base::SplitString(observed_form_.origin.path(), "/",
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ }
}
PasswordFormManager::~PasswordFormManager() {
@@ -938,8 +941,9 @@ int PasswordFormManager::ScoreResult(const PasswordForm& candidate) const {
} else {
// Walk the origin URL paths one directory at a time to see how
// deep the two match.
- std::vector<std::string> candidate_path_tokens;
- base::SplitString(candidate.origin.path(), '/', &candidate_path_tokens);
+ std::vector<std::string> candidate_path_tokens =
+ base::SplitString(candidate.origin.path(), "/", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
size_t depth = 0;
size_t max_dirs =
std::min(form_path_tokens_.size(), candidate_path_tokens.size());
« no previous file with comments | « components/omnibox/browser/autocomplete_input.cc ('k') | components/proximity_auth/bluetooth_util_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698