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/ui/webui/extensions/extension_icon_source.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "extensions/common/extension_resource.h" | 26 #include "extensions/common/extension_resource.h" |
27 #include "extensions/common/manifest_handlers/icons_handler.h" | 27 #include "extensions/common/manifest_handlers/icons_handler.h" |
28 #include "extensions/grit/extensions_browser_resources.h" | 28 #include "extensions/grit/extensions_browser_resources.h" |
29 #include "grit/component_extension_resources_map.h" | 29 #include "grit/component_extension_resources_map.h" |
30 #include "skia/ext/image_operations.h" | 30 #include "skia/ext/image_operations.h" |
31 #include "ui/base/layout.h" | 31 #include "ui/base/layout.h" |
32 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
33 #include "ui/gfx/codec/png_codec.h" | 33 #include "ui/gfx/codec/png_codec.h" |
34 #include "ui/gfx/color_utils.h" | 34 #include "ui/gfx/color_utils.h" |
35 #include "ui/gfx/favicon_size.h" | 35 #include "ui/gfx/favicon_size.h" |
36 #include "ui/gfx/size.h" | 36 #include "ui/gfx/geometry/size.h" |
37 #include "ui/gfx/skbitmap_operations.h" | 37 #include "ui/gfx/skbitmap_operations.h" |
38 #include "url/gurl.h" | 38 #include "url/gurl.h" |
39 | 39 |
40 namespace extensions { | 40 namespace extensions { |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 scoped_refptr<base::RefCountedMemory> BitmapToMemory(const SkBitmap* image) { | 44 scoped_refptr<base::RefCountedMemory> BitmapToMemory(const SkBitmap* image) { |
45 base::RefCountedBytes* image_bytes = new base::RefCountedBytes; | 45 base::RefCountedBytes* image_bytes = new base::RefCountedBytes; |
46 gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &image_bytes->data()); | 46 gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &image_bytes->data()); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 std::map<int, ExtensionIconRequest*>::iterator i = | 341 std::map<int, ExtensionIconRequest*>::iterator i = |
342 request_map_.find(request_id); | 342 request_map_.find(request_id); |
343 if (i == request_map_.end()) | 343 if (i == request_map_.end()) |
344 return; | 344 return; |
345 | 345 |
346 delete i->second; | 346 delete i->second; |
347 request_map_.erase(i); | 347 request_map_.erase(i); |
348 } | 348 } |
349 | 349 |
350 } // namespace extensions | 350 } // namespace extensions |
OLD | NEW |