OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ui/base/resource/data_pack.h" | 22 #include "ui/base/resource/data_pack.h" |
23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/gfx/codec/png_codec.h" | 24 #include "ui/gfx/codec/png_codec.h" |
25 #include "ui/gfx/image/image.h" | 25 #include "ui/gfx/image/image.h" |
26 #include "ui/gfx/skbitmap_operations.h" | 26 #include "ui/gfx/skbitmap_operations.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Version number of the current theme pack. We just throw out and rebuild | 30 // Version number of the current theme pack. We just throw out and rebuild |
31 // theme packs that aren't int-equal to this. | 31 // theme packs that aren't int-equal to this. |
32 const int kThemePackVersion = 16; | 32 const int kThemePackVersion = 17; |
33 | 33 |
34 // IDs that are in the DataPack won't clash with the positive integer | 34 // IDs that are in the DataPack won't clash with the positive integer |
35 // uint16. kHeaderID should always have the maximum value because we want the | 35 // uint16. kHeaderID should always have the maximum value because we want the |
36 // "header" to be written last. That way we can detect whether the pack was | 36 // "header" to be written last. That way we can detect whether the pack was |
37 // successfully written and ignore and regenerate if it was only partially | 37 // successfully written and ignore and regenerate if it was only partially |
38 // written (i.e. chrome crashed on a different thread while writing the pack). | 38 // written (i.e. chrome crashed on a different thread while writing the pack). |
39 const int kHeaderID = std::numeric_limits<uint16>::max() - 1; | 39 const int kHeaderID = std::numeric_limits<uint16>::max() - 1; |
40 const int kTintsID = std::numeric_limits<uint16>::max() - 2; | 40 const int kTintsID = std::numeric_limits<uint16>::max() - 2; |
41 const int kColorsID = std::numeric_limits<uint16>::max() - 3; | 41 const int kColorsID = std::numeric_limits<uint16>::max() - 3; |
42 const int kDisplayPropertiesID = std::numeric_limits<uint16>::max() - 4; | 42 const int kDisplayPropertiesID = std::numeric_limits<uint16>::max() - 4; |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 hsl.h = tints_[i].h; | 1059 hsl.h = tints_[i].h; |
1060 hsl.s = tints_[i].s; | 1060 hsl.s = tints_[i].s; |
1061 hsl.l = tints_[i].l; | 1061 hsl.l = tints_[i].l; |
1062 return hsl; | 1062 return hsl; |
1063 } | 1063 } |
1064 } | 1064 } |
1065 } | 1065 } |
1066 | 1066 |
1067 return ThemeService::GetDefaultTint(id); | 1067 return ThemeService::GetDefaultTint(id); |
1068 } | 1068 } |
OLD | NEW |