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

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

Issue 7604012: Remove the length field from the index entries in data pack files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix write Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/themes/browser_theme_pack_unittest.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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/themes/browser_theme_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698