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/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "chrome/browser/themes/theme_properties.h" | 19 #include "chrome/browser/themes/theme_properties.h" |
20 #include "chrome/common/extensions/manifest_handlers/theme_handler.h" | 20 #include "chrome/common/extensions/manifest_handlers/theme_handler.h" |
21 #include "components/crx_file/id_util.h" | 21 #include "components/crx_file/id_util.h" |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
24 #include "third_party/skia/include/core/SkCanvas.h" | 24 #include "third_party/skia/include/core/SkCanvas.h" |
25 #include "ui/base/resource/data_pack.h" | 25 #include "ui/base/resource/data_pack.h" |
26 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
27 #include "ui/gfx/canvas.h" | 27 #include "ui/gfx/canvas.h" |
28 #include "ui/gfx/codec/png_codec.h" | 28 #include "ui/gfx/codec/png_codec.h" |
| 29 #include "ui/gfx/geometry/size_conversions.h" |
29 #include "ui/gfx/image/canvas_image_source.h" | 30 #include "ui/gfx/image/canvas_image_source.h" |
30 #include "ui/gfx/image/image.h" | 31 #include "ui/gfx/image/image.h" |
31 #include "ui/gfx/image/image_skia.h" | 32 #include "ui/gfx/image/image_skia.h" |
32 #include "ui/gfx/image/image_skia_operations.h" | 33 #include "ui/gfx/image/image_skia_operations.h" |
33 #include "ui/gfx/screen.h" | 34 #include "ui/gfx/screen.h" |
34 #include "ui/gfx/size_conversions.h" | |
35 #include "ui/gfx/skia_util.h" | 35 #include "ui/gfx/skia_util.h" |
36 #include "ui/resources/grit/ui_resources.h" | 36 #include "ui/resources/grit/ui_resources.h" |
37 | 37 |
38 using content::BrowserThread; | 38 using content::BrowserThread; |
39 using extensions::Extension; | 39 using extensions::Extension; |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 // Version number of the current theme pack. We just throw out and rebuild | 43 // Version number of the current theme pack. We just throw out and rebuild |
44 // theme packs that aren't int-equal to this. Increment this number if you | 44 // theme packs that aren't int-equal to this. Increment this number if you |
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 false, | 1629 false, |
1630 &bitmap_data)) { | 1630 &bitmap_data)) { |
1631 NOTREACHED() << "Unable to encode theme image for prs_id=" | 1631 NOTREACHED() << "Unable to encode theme image for prs_id=" |
1632 << prs_id << " for scale_factor=" << scale_factors_[i]; | 1632 << prs_id << " for scale_factor=" << scale_factors_[i]; |
1633 break; | 1633 break; |
1634 } | 1634 } |
1635 image_memory_[scaled_raw_id] = | 1635 image_memory_[scaled_raw_id] = |
1636 base::RefCountedBytes::TakeVector(&bitmap_data); | 1636 base::RefCountedBytes::TakeVector(&bitmap_data); |
1637 } | 1637 } |
1638 } | 1638 } |
OLD | NEW |