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/icon_loader.h" | 5 #include "chrome/browser/icon_loader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 void IconLoader::ReadIcon() { | 196 void IconLoader::ReadIcon() { |
197 static base::LazyInstance<IconMapper>::Leaky icon_mapper = | 197 static base::LazyInstance<IconMapper>::Leaky icon_mapper = |
198 LAZY_INSTANCE_INITIALIZER; | 198 LAZY_INSTANCE_INITIALIZER; |
199 int idr = icon_mapper.Get().Lookup(group_, icon_size_); | 199 int idr = icon_mapper.Get().Lookup(group_, icon_size_); |
200 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 200 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
201 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), | 201 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), |
202 IconSizeToDIPSize(icon_size_))); | 202 IconSizeToDIPSize(icon_size_))); |
203 image_skia.MakeThreadSafe(); | 203 image_skia.MakeThreadSafe(); |
204 image_.reset(new gfx::Image(image_skia)); | 204 image_.reset(new gfx::Image(image_skia)); |
205 target_task_runner_->PostTask( | 205 target_task_runner_->PostTask(FROM_HERE, |
206 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); | 206 base::Bind(callback_, base::Unretained(this), |
| 207 base::Passed(&image_), group_)); |
207 } | 208 } |
OLD | NEW |