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

Side by Side Diff: chrome/browser/extensions/image_loader.cc

Issue 211493009: Ensure that extension resources are loaded with the correct scaling applied on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix try server errors Created 6 years, 9 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
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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698