| 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/extensions/image_loader.h" | 5 #include "chrome/browser/extensions/image_loader.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 gfx::ImageSkia image_skia; | 356 gfx::ImageSkia image_skia; |
| 357 | 357 |
| 358 for (std::vector<LoadResult>::const_iterator it = load_result.begin(); | 358 for (std::vector<LoadResult>::const_iterator it = load_result.begin(); |
| 359 it != load_result.end(); ++it) { | 359 it != load_result.end(); ++it) { |
| 360 const SkBitmap& bitmap = it->bitmap; | 360 const SkBitmap& bitmap = it->bitmap; |
| 361 const ImageRepresentation& image_rep = it->image_representation; | 361 const ImageRepresentation& image_rep = it->image_representation; |
| 362 | 362 |
| 363 image_skia.AddRepresentation(gfx::ImageSkiaRep( | 363 image_skia.AddRepresentation(gfx::ImageSkiaRep( |
| 364 bitmap, | 364 bitmap, |
| 365 ui::GetImageScale(image_rep.scale_factor))); | 365 ui::ResourceBundle::PlatformGetImageScale(image_rep.scale_factor))); |
| 366 } | 366 } |
| 367 | 367 |
| 368 gfx::Image image; | 368 gfx::Image image; |
| 369 if (!image_skia.isNull()) { | 369 if (!image_skia.isNull()) { |
| 370 image_skia.MakeThreadSafe(); | 370 image_skia.MakeThreadSafe(); |
| 371 image = gfx::Image(image_skia); | 371 image = gfx::Image(image_skia); |
| 372 } | 372 } |
| 373 | 373 |
| 374 callback.Run(image); | 374 callback.Run(image); |
| 375 } | 375 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 400 it != image_skia_map.end(); | 400 it != image_skia_map.end(); |
| 401 ++it) { | 401 ++it) { |
| 402 it->second.MakeThreadSafe(); | 402 it->second.MakeThreadSafe(); |
| 403 image_family.Add(it->second); | 403 image_family.Add(it->second); |
| 404 } | 404 } |
| 405 | 405 |
| 406 callback.Run(image_family); | 406 callback.Run(image_family); |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace extensions | 409 } // namespace extensions |
| OLD | NEW |