OLD | NEW |
---|---|
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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
880 | 880 |
881 BrowserThemePack::BrowserThemePack() | 881 BrowserThemePack::BrowserThemePack() |
882 : CustomThemeSupplier(EXTENSION), | 882 : CustomThemeSupplier(EXTENSION), |
883 header_(NULL), | 883 header_(NULL), |
884 tints_(NULL), | 884 tints_(NULL), |
885 colors_(NULL), | 885 colors_(NULL), |
886 display_properties_(NULL), | 886 display_properties_(NULL), |
887 source_images_(NULL) { | 887 source_images_(NULL) { |
888 scale_factors_ = ui::GetSupportedScaleFactors(); | 888 scale_factors_ = ui::GetSupportedScaleFactors(); |
889 // On Windows HiDPI SCALE_FACTOR_100P may not be supported by default. | 889 // On Windows HiDPI SCALE_FACTOR_100P may not be supported by default. |
890 if (std::find(scale_factors_.begin(), scale_factors_.end(), | 890 if (!ContainsValue(scale_factors_, ui::SCALE_FACTOR_100P)) { |
sky
2016/03/02 17:19:35
nit: no {}
chakshu
2016/03/07 08:10:46
Done.
| |
891 ui::SCALE_FACTOR_100P) == scale_factors_.end()) { | |
892 scale_factors_.push_back(ui::SCALE_FACTOR_100P); | 891 scale_factors_.push_back(ui::SCALE_FACTOR_100P); |
893 } | 892 } |
894 } | 893 } |
895 | 894 |
896 void BrowserThemePack::BuildHeader(const Extension* extension) { | 895 void BrowserThemePack::BuildHeader(const Extension* extension) { |
897 header_ = new BrowserThemePackHeader; | 896 header_ = new BrowserThemePackHeader; |
898 header_->version = kThemePackVersion; | 897 header_->version = kThemePackVersion; |
899 | 898 |
900 // TODO(erg): Need to make this endian safe on other computers. Prerequisite | 899 // TODO(erg): Need to make this endian safe on other computers. Prerequisite |
901 // is that ui::DataPack removes this same check. | 900 // is that ui::DataPack removes this same check. |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1541 false, | 1540 false, |
1542 &bitmap_data)) { | 1541 &bitmap_data)) { |
1543 NOTREACHED() << "Unable to encode theme image for prs_id=" | 1542 NOTREACHED() << "Unable to encode theme image for prs_id=" |
1544 << prs_id << " for scale_factor=" << scale_factors_[i]; | 1543 << prs_id << " for scale_factor=" << scale_factors_[i]; |
1545 break; | 1544 break; |
1546 } | 1545 } |
1547 image_memory_[scaled_raw_id] = | 1546 image_memory_[scaled_raw_id] = |
1548 base::RefCountedBytes::TakeVector(&bitmap_data); | 1547 base::RefCountedBytes::TakeVector(&bitmap_data); |
1549 } | 1548 } |
1550 } | 1549 } |
OLD | NEW |