OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/themes/theme_properties.h" | 5 #include "chrome/browser/themes/theme_properties.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/themes/browser_theme_pack.h" | 10 #include "chrome/browser/themes/browser_theme_pack.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } // namespace | 136 } // namespace |
137 | 137 |
138 // static | 138 // static |
139 int ThemeProperties::StringToAlignment(const std::string& alignment) { | 139 int ThemeProperties::StringToAlignment(const std::string& alignment) { |
140 std::vector<std::string> split; | 140 std::vector<std::string> split; |
141 base::SplitStringAlongWhitespace(alignment, &split); | 141 base::SplitStringAlongWhitespace(alignment, &split); |
142 | 142 |
143 int alignment_mask = 0; | 143 int alignment_mask = 0; |
144 for (std::vector<std::string>::iterator component(split.begin()); | 144 for (std::vector<std::string>::iterator component(split.begin()); |
145 component != split.end(); ++component) { | 145 component != split.end(); ++component) { |
146 if (LowerCaseEqualsASCII(*component, kAlignmentTop)) | 146 if (base::LowerCaseEqualsASCII(*component, kAlignmentTop)) |
147 alignment_mask |= ALIGN_TOP; | 147 alignment_mask |= ALIGN_TOP; |
148 else if (LowerCaseEqualsASCII(*component, kAlignmentBottom)) | 148 else if (base::LowerCaseEqualsASCII(*component, kAlignmentBottom)) |
149 alignment_mask |= ALIGN_BOTTOM; | 149 alignment_mask |= ALIGN_BOTTOM; |
150 else if (LowerCaseEqualsASCII(*component, kAlignmentLeft)) | 150 else if (base::LowerCaseEqualsASCII(*component, kAlignmentLeft)) |
151 alignment_mask |= ALIGN_LEFT; | 151 alignment_mask |= ALIGN_LEFT; |
152 else if (LowerCaseEqualsASCII(*component, kAlignmentRight)) | 152 else if (base::LowerCaseEqualsASCII(*component, kAlignmentRight)) |
153 alignment_mask |= ALIGN_RIGHT; | 153 alignment_mask |= ALIGN_RIGHT; |
154 } | 154 } |
155 return alignment_mask; | 155 return alignment_mask; |
156 } | 156 } |
157 | 157 |
158 // static | 158 // static |
159 int ThemeProperties::StringToTiling(const std::string& tiling) { | 159 int ThemeProperties::StringToTiling(const std::string& tiling) { |
160 const char* component = tiling.c_str(); | 160 const char* component = tiling.c_str(); |
161 | 161 |
162 if (base::strcasecmp(component, kTilingRepeatX) == 0) | 162 if (base::strcasecmp(component, kTilingRepeatX) == 0) |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 case NTP_BACKGROUND_ALIGNMENT: | 311 case NTP_BACKGROUND_ALIGNMENT: |
312 return kDefaultDisplayPropertyNTPAlignment; | 312 return kDefaultDisplayPropertyNTPAlignment; |
313 case NTP_BACKGROUND_TILING: | 313 case NTP_BACKGROUND_TILING: |
314 return kDefaultDisplayPropertyNTPTiling; | 314 return kDefaultDisplayPropertyNTPTiling; |
315 case NTP_LOGO_ALTERNATE: | 315 case NTP_LOGO_ALTERNATE: |
316 return kDefaultDisplayPropertyNTPAlternateLogo; | 316 return kDefaultDisplayPropertyNTPAlternateLogo; |
317 } | 317 } |
318 | 318 |
319 return -1; | 319 return -1; |
320 } | 320 } |
OLD | NEW |