Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 using content::BrowserThread; | 42 using content::BrowserThread; |
| 43 using extensions::Extension; | 43 using extensions::Extension; |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 // Version number of the current theme pack. We just throw out and rebuild | 47 // Version number of the current theme pack. We just throw out and rebuild |
| 48 // theme packs that aren't int-equal to this. Increment this number if you | 48 // theme packs that aren't int-equal to this. Increment this number if you |
| 49 // change default theme assets or if you need themes to recreate their generated | 49 // change default theme assets or if you need themes to recreate their generated |
| 50 // images (which are cached). | 50 // images (which are cached). |
| 51 const int kThemePackVersion = 45; | 51 const int kThemePackVersion = 44; |
|
Evan Stade
2017/02/01 01:49:33
think you need to bump this to 46
Bret
2017/02/01 02:12:35
Hmm... I figured that since this is just used to d
Bret
2017/02/03 20:13:13
Someone bumped this to 46 already, so never mind.
| |
| 52 | 52 |
| 53 // IDs that are in the DataPack won't clash with the positive integer | 53 // IDs that are in the DataPack won't clash with the positive integer |
| 54 // uint16_t. kHeaderID should always have the maximum value because we want the | 54 // uint16_t. kHeaderID should always have the maximum value because we want the |
| 55 // "header" to be written last. That way we can detect whether the pack was | 55 // "header" to be written last. That way we can detect whether the pack was |
| 56 // successfully written and ignore and regenerate if it was only partially | 56 // successfully written and ignore and regenerate if it was only partially |
| 57 // written (i.e. chrome crashed on a different thread while writing the pack). | 57 // written (i.e. chrome crashed on a different thread while writing the pack). |
| 58 const int kMaxID = 0x0000FFFF; // Max unsigned 16-bit int. | 58 const int kMaxID = 0x0000FFFF; // Max unsigned 16-bit int. |
| 59 const int kHeaderID = kMaxID - 1; | 59 const int kHeaderID = kMaxID - 1; |
| 60 const int kTintsID = kMaxID - 2; | 60 const int kTintsID = kMaxID - 2; |
| 61 const int kColorsID = kMaxID - 3; | 61 const int kColorsID = kMaxID - 3; |
| (...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1452 false, | 1452 false, |
| 1453 &bitmap_data)) { | 1453 &bitmap_data)) { |
| 1454 NOTREACHED() << "Unable to encode theme image for prs_id=" | 1454 NOTREACHED() << "Unable to encode theme image for prs_id=" |
| 1455 << prs_id << " for scale_factor=" << scale_factors_[i]; | 1455 << prs_id << " for scale_factor=" << scale_factors_[i]; |
| 1456 break; | 1456 break; |
| 1457 } | 1457 } |
| 1458 image_memory_[scaled_raw_id] = | 1458 image_memory_[scaled_raw_id] = |
| 1459 base::RefCountedBytes::TakeVector(&bitmap_data); | 1459 base::RefCountedBytes::TakeVector(&bitmap_data); |
| 1460 } | 1460 } |
| 1461 } | 1461 } |
| OLD | NEW |