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

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

Issue 1715683002: chrome: Use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing non ContainsValue changes Created 4 years, 9 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
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.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 882
883 BrowserThemePack::BrowserThemePack() 883 BrowserThemePack::BrowserThemePack()
884 : CustomThemeSupplier(EXTENSION), 884 : CustomThemeSupplier(EXTENSION),
885 header_(NULL), 885 header_(NULL),
886 tints_(NULL), 886 tints_(NULL),
887 colors_(NULL), 887 colors_(NULL),
888 display_properties_(NULL), 888 display_properties_(NULL),
889 source_images_(NULL) { 889 source_images_(NULL) {
890 scale_factors_ = ui::GetSupportedScaleFactors(); 890 scale_factors_ = ui::GetSupportedScaleFactors();
891 // On Windows HiDPI SCALE_FACTOR_100P may not be supported by default. 891 // On Windows HiDPI SCALE_FACTOR_100P may not be supported by default.
892 if (std::find(scale_factors_.begin(), scale_factors_.end(), 892 if (!ContainsValue(scale_factors_, ui::SCALE_FACTOR_100P))
893 ui::SCALE_FACTOR_100P) == scale_factors_.end()) {
894 scale_factors_.push_back(ui::SCALE_FACTOR_100P); 893 scale_factors_.push_back(ui::SCALE_FACTOR_100P);
895 }
896 } 894 }
897 895
898 void BrowserThemePack::BuildHeader(const Extension* extension) { 896 void BrowserThemePack::BuildHeader(const Extension* extension) {
899 header_ = new BrowserThemePackHeader; 897 header_ = new BrowserThemePackHeader;
900 header_->version = kThemePackVersion; 898 header_->version = kThemePackVersion;
901 899
902 // TODO(erg): Need to make this endian safe on other computers. Prerequisite 900 // TODO(erg): Need to make this endian safe on other computers. Prerequisite
903 // is that ui::DataPack removes this same check. 901 // is that ui::DataPack removes this same check.
904 #if defined(__BYTE_ORDER) 902 #if defined(__BYTE_ORDER)
905 // Linux check 903 // Linux check
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 false, 1541 false,
1544 &bitmap_data)) { 1542 &bitmap_data)) {
1545 NOTREACHED() << "Unable to encode theme image for prs_id=" 1543 NOTREACHED() << "Unable to encode theme image for prs_id="
1546 << prs_id << " for scale_factor=" << scale_factors_[i]; 1544 << prs_id << " for scale_factor=" << scale_factors_[i];
1547 break; 1545 break;
1548 } 1546 }
1549 image_memory_[scaled_raw_id] = 1547 image_memory_[scaled_raw_id] =
1550 base::RefCountedBytes::TakeVector(&bitmap_data); 1548 base::RefCountedBytes::TakeVector(&bitmap_data);
1551 } 1549 }
1552 } 1550 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698