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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_icon_source.cc

Issue 10272004: Move RefCountedMemory class to base namespace. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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 | « chrome/browser/ui/webui/downloads_ui.cc ('k') | chrome/browser/ui/webui/favicon_source.h » ('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) 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 13 matching lines...) Expand all
24 #include "googleurl/src/gurl.h" 24 #include "googleurl/src/gurl.h"
25 #include "skia/ext/image_operations.h" 25 #include "skia/ext/image_operations.h"
26 #include "ui/base/resource/resource_bundle.h" 26 #include "ui/base/resource/resource_bundle.h"
27 #include "ui/gfx/codec/png_codec.h" 27 #include "ui/gfx/codec/png_codec.h"
28 #include "ui/gfx/color_utils.h" 28 #include "ui/gfx/color_utils.h"
29 #include "ui/gfx/skbitmap_operations.h" 29 #include "ui/gfx/skbitmap_operations.h"
30 #include "webkit/glue/image_decoder.h" 30 #include "webkit/glue/image_decoder.h"
31 31
32 namespace { 32 namespace {
33 33
34 scoped_refptr<RefCountedMemory> BitmapToMemory(const SkBitmap* image) { 34 scoped_refptr<base::RefCountedMemory> BitmapToMemory(const SkBitmap* image) {
35 base::RefCountedBytes* image_bytes = new base::RefCountedBytes; 35 base::RefCountedBytes* image_bytes = new base::RefCountedBytes;
36 gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &image_bytes->data()); 36 gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &image_bytes->data());
37 return image_bytes; 37 return image_bytes;
38 } 38 }
39 39
40 SkBitmap DesaturateImage(const SkBitmap* image) { 40 SkBitmap DesaturateImage(const SkBitmap* image) {
41 color_utils::HSL shift = {-1, 0, 0.6}; 41 color_utils::HSL shift = {-1, 0, 0.6};
42 return SkBitmapOperations::CreateHSLShiftedBitmap(*image, shift); 42 return SkBitmapOperations::CreateHSLShiftedBitmap(*image, shift);
43 } 43 }
44 44
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 void ExtensionIconSource::ClearData(int request_id) { 337 void ExtensionIconSource::ClearData(int request_id) {
338 std::map<int, ExtensionIconRequest*>::iterator i = 338 std::map<int, ExtensionIconRequest*>::iterator i =
339 request_map_.find(request_id); 339 request_map_.find(request_id);
340 if (i == request_map_.end()) 340 if (i == request_map_.end())
341 return; 341 return;
342 342
343 delete i->second; 343 delete i->second;
344 request_map_.erase(i); 344 request_map_.erase(i);
345 } 345 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/downloads_ui.cc ('k') | chrome/browser/ui/webui/favicon_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698