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

Side by Side Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/themes/theme_properties.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_theme_pack.h" 5 #include "chrome/browser/themes/browser_theme_pack.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 "theme_tab_background_incognito" }, 202 "theme_tab_background_incognito" },
203 }; 203 };
204 const size_t kPersistingImagesDesktopAuraLength = 204 const size_t kPersistingImagesDesktopAuraLength =
205 arraysize(kPersistingImagesDesktopAura); 205 arraysize(kPersistingImagesDesktopAura);
206 #endif 206 #endif
207 207
208 int GetPersistentIDByNameHelper(const std::string& key, 208 int GetPersistentIDByNameHelper(const std::string& key,
209 const PersistingImagesTable* image_table, 209 const PersistingImagesTable* image_table,
210 size_t image_table_size) { 210 size_t image_table_size) {
211 for (size_t i = 0; i < image_table_size; ++i) { 211 for (size_t i = 0; i < image_table_size; ++i) {
212 if (image_table[i].key && LowerCaseEqualsASCII(key, image_table[i].key)) { 212 if (image_table[i].key &&
213 base::LowerCaseEqualsASCII(key, image_table[i].key)) {
213 return image_table[i].persistent_id; 214 return image_table[i].persistent_id;
214 } 215 }
215 } 216 }
216 return -1; 217 return -1;
217 } 218 }
218 219
219 int GetPersistentIDByName(const std::string& key) { 220 int GetPersistentIDByName(const std::string& key) {
220 return GetPersistentIDByNameHelper(key, 221 return GetPersistentIDByNameHelper(key,
221 kPersistingImages, 222 kPersistingImages,
222 kPersistingImagesLength); 223 kPersistingImagesLength);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ThemeProperties::NTP_BACKGROUND_ALIGNMENT }, 338 ThemeProperties::NTP_BACKGROUND_ALIGNMENT },
338 { "ntp_background_repeat", ThemeProperties::NTP_BACKGROUND_TILING }, 339 { "ntp_background_repeat", ThemeProperties::NTP_BACKGROUND_TILING },
339 { "ntp_logo_alternate", ThemeProperties::NTP_LOGO_ALTERNATE }, 340 { "ntp_logo_alternate", ThemeProperties::NTP_LOGO_ALTERNATE },
340 }; 341 };
341 const size_t kDisplayPropertiesSize = arraysize(kDisplayProperties); 342 const size_t kDisplayPropertiesSize = arraysize(kDisplayProperties);
342 343
343 int GetIntForString(const std::string& key, 344 int GetIntForString(const std::string& key,
344 StringToIntTable* table, 345 StringToIntTable* table,
345 size_t table_length) { 346 size_t table_length) {
346 for (size_t i = 0; i < table_length; ++i) { 347 for (size_t i = 0; i < table_length; ++i) {
347 if (LowerCaseEqualsASCII(key, table[i].key)) { 348 if (base::LowerCaseEqualsASCII(key, table[i].key)) {
348 return table[i].id; 349 return table[i].id;
349 } 350 }
350 } 351 }
351 352
352 return -1; 353 return -1;
353 } 354 }
354 355
355 struct IntToIntTable { 356 struct IntToIntTable {
356 int key; 357 int key;
357 int value; 358 int value;
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 false, 1634 false,
1634 &bitmap_data)) { 1635 &bitmap_data)) {
1635 NOTREACHED() << "Unable to encode theme image for prs_id=" 1636 NOTREACHED() << "Unable to encode theme image for prs_id="
1636 << prs_id << " for scale_factor=" << scale_factors_[i]; 1637 << prs_id << " for scale_factor=" << scale_factors_[i];
1637 break; 1638 break;
1638 } 1639 }
1639 image_memory_[scaled_raw_id] = 1640 image_memory_[scaled_raw_id] =
1640 base::RefCountedBytes::TakeVector(&bitmap_data); 1641 base::RefCountedBytes::TakeVector(&bitmap_data);
1641 } 1642 }
1642 } 1643 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/themes/theme_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698