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

Unified Diff: chrome/browser/themes/theme_properties.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/browser/sxs_linux.cc ('k') | chrome/browser/tracing/crash_service_uploader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_properties.cc
diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc
index 16eaaa00e5c1b5bb7a41ad9dedfc52c5062ad9f7..98b6d5c3e6daced537ab973b2959203e70668115 100644
--- a/chrome/browser/themes/theme_properties.cc
+++ b/chrome/browser/themes/theme_properties.cc
@@ -177,19 +177,17 @@ SkColor TintForUnderline(SkColor input) {
// static
int ThemeProperties::StringToAlignment(const std::string& alignment) {
- std::vector<std::string> split;
- base::SplitStringAlongWhitespace(alignment, &split);
-
int alignment_mask = 0;
- for (std::vector<std::string>::iterator component(split.begin());
- component != split.end(); ++component) {
- if (base::LowerCaseEqualsASCII(*component, kAlignmentTop))
+ for (const std::string& component : base::SplitString(
+ alignment, base::kWhitespaceASCII,
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
+ if (base::LowerCaseEqualsASCII(component, kAlignmentTop))
alignment_mask |= ALIGN_TOP;
- else if (base::LowerCaseEqualsASCII(*component, kAlignmentBottom))
+ else if (base::LowerCaseEqualsASCII(component, kAlignmentBottom))
alignment_mask |= ALIGN_BOTTOM;
- else if (base::LowerCaseEqualsASCII(*component, kAlignmentLeft))
+ else if (base::LowerCaseEqualsASCII(component, kAlignmentLeft))
alignment_mask |= ALIGN_LEFT;
- else if (base::LowerCaseEqualsASCII(*component, kAlignmentRight))
+ else if (base::LowerCaseEqualsASCII(component, kAlignmentRight))
alignment_mask |= ALIGN_RIGHT;
}
return alignment_mask;
« no previous file with comments | « chrome/browser/sxs_linux.cc ('k') | chrome/browser/tracing/crash_service_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698