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> | 7 #include <limits> |
8 | 8 |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/gfx/image/image_skia.h" | 28 #include "ui/gfx/image/image_skia.h" |
29 #include "ui/gfx/skbitmap_operations.h" | 29 #include "ui/gfx/skbitmap_operations.h" |
30 | 30 |
31 using content::BrowserThread; | 31 using content::BrowserThread; |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 // Version number of the current theme pack. We just throw out and rebuild | 35 // Version number of the current theme pack. We just throw out and rebuild |
36 // theme packs that aren't int-equal to this. Increment this number if you | 36 // theme packs that aren't int-equal to this. Increment this number if you |
37 // change default theme assets. | 37 // change default theme assets. |
38 const int kThemePackVersion = 20; | 38 const int kThemePackVersion = 21; |
39 | 39 |
40 // IDs that are in the DataPack won't clash with the positive integer | 40 // IDs that are in the DataPack won't clash with the positive integer |
41 // uint16. kHeaderID should always have the maximum value because we want the | 41 // uint16. kHeaderID should always have the maximum value because we want the |
42 // "header" to be written last. That way we can detect whether the pack was | 42 // "header" to be written last. That way we can detect whether the pack was |
43 // successfully written and ignore and regenerate if it was only partially | 43 // successfully written and ignore and regenerate if it was only partially |
44 // written (i.e. chrome crashed on a different thread while writing the pack). | 44 // written (i.e. chrome crashed on a different thread while writing the pack). |
45 const int kMaxID = 0x0000FFFF; // Max unsigned 16-bit int. | 45 const int kMaxID = 0x0000FFFF; // Max unsigned 16-bit int. |
46 const int kHeaderID = kMaxID - 1; | 46 const int kHeaderID = kMaxID - 1; |
47 const int kTintsID = kMaxID - 2; | 47 const int kTintsID = kMaxID - 2; |
48 const int kColorsID = kMaxID - 3; | 48 const int kColorsID = kMaxID - 3; |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 hsl.h = tints_[i].h; | 1070 hsl.h = tints_[i].h; |
1071 hsl.s = tints_[i].s; | 1071 hsl.s = tints_[i].s; |
1072 hsl.l = tints_[i].l; | 1072 hsl.l = tints_[i].l; |
1073 return hsl; | 1073 return hsl; |
1074 } | 1074 } |
1075 } | 1075 } |
1076 } | 1076 } |
1077 | 1077 |
1078 return ThemeService::GetDefaultTint(id); | 1078 return ThemeService::GetDefaultTint(id); |
1079 } | 1079 } |
OLD | NEW |