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

Unified Diff: chrome/common/extensions/command.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | chrome/common/importer/firefox_importer_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/command.cc
diff --git a/chrome/common/extensions/command.cc b/chrome/common/extensions/command.cc
index fc4b47bc44e7b6ffcf867230ab5196b6d319fa7f..9604c06a4413191d02f72e449f3ffabd0ed9444a 100644
--- a/chrome/common/extensions/command.cc
+++ b/chrome/common/extensions/command.cc
@@ -74,8 +74,8 @@ ui::Accelerator ParseImpl(const std::string& accelerator,
return ui::Accelerator();
}
- std::vector<std::string> tokens;
- base::SplitString(accelerator, '+', &tokens);
+ std::vector<std::string> tokens = base::SplitString(
+ accelerator, "+", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (tokens.size() == 0 ||
(tokens.size() == 1 && DoesRequireModifier(accelerator)) ||
tokens.size() > kMaxTokenSize) {
@@ -264,8 +264,8 @@ std::string NormalizeShortcutSuggestion(const std::string& suggestion,
if (!normalize)
return suggestion;
- std::vector<std::string> tokens;
- base::SplitString(suggestion, '+', &tokens);
+ std::vector<std::string> tokens = base::SplitString(
+ suggestion, "+", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
for (size_t i = 0; i < tokens.size(); i++) {
if (tokens[i] == values::kKeyCtrl)
tokens[i] = values::kKeyCommand;
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | chrome/common/importer/firefox_importer_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698