diff options
author | brettw <brettw@chromium.org> | 2015-07-21 14:37:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-21 21:38:12 +0000 |
commit | c6f82b158f374c172a46326699f03d97777faa8e (patch) | |
tree | c96472fa185ca20b22fad773cd195689e4097894 /chrome/browser/chromeos/preferences.cc | |
parent | db484c3eff68c46ddf1530dd60441dba4614cb5c (diff) | |
download | chromium_src-c6f82b158f374c172a46326699f03d97777faa8e.zip chromium_src-c6f82b158f374c172a46326699f03d97777faa8e.tar.gz chromium_src-c6f82b158f374c172a46326699f03d97777faa8e.tar.bz2 |
Update SplitString calls in chrome.
In many places that iterated over the results, the code was changed to use a range-based for loop over the result of the SplitStirng call.
Review URL: https://codereview.chromium.org/1240183002
Cr-Commit-Position: refs/heads/master@{#339753}
Diffstat (limited to 'chrome/browser/chromeos/preferences.cc')
-rw-r--r-- | chrome/browser/chromeos/preferences.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index e19c8ff..848c825 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -553,9 +553,10 @@ void Preferences::ApplyPreferences(ApplyReason reason, std::string value(enabled_extension_imes_.GetValue()); std::vector<std::string> split_values; - if (!value.empty()) - base::SplitString(value, ',', &split_values); - + if (!value.empty()) { + split_values = base::SplitString(value, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_ALL); + } ime_state_->SetEnabledExtensionImes(&split_values); } @@ -622,8 +623,10 @@ void Preferences::SetLanguageConfigStringListAsCSV(const char* section, VLOG(1) << "Setting " << name << " to '" << value << "'"; std::vector<std::string> split_values; - if (!value.empty()) - base::SplitString(value, ',', &split_values); + if (!value.empty()) { + split_values = base::SplitString(value, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_ALL); + } // Transfers the xkb id to extension-xkb id. if (input_method_manager_->MigrateInputMethods(&split_values)) |