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

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

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 327 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
328 328
329 gfx::ImageSkia image_skia; 329 gfx::ImageSkia image_skia;
330 330
331 for (std::vector<LoadResult>::const_iterator it = load_result->begin(); 331 for (std::vector<LoadResult>::const_iterator it = load_result->begin();
332 it != load_result->end(); ++it) { 332 it != load_result->end(); ++it) {
333 const SkBitmap& bitmap = it->bitmap; 333 const SkBitmap& bitmap = it->bitmap;
334 const ImageRepresentation& image_rep = it->image_representation; 334 const ImageRepresentation& image_rep = it->image_representation;
335 335
336 image_skia.AddRepresentation(gfx::ImageSkiaRep( 336 image_skia.AddRepresentation(gfx::ImageSkiaRep(
337 bitmap, image_rep.scale_factor)); 337 bitmap,
338 ui::GetImageScale(image_rep.scale_factor)));
338 } 339 }
339 340
340 gfx::Image image; 341 gfx::Image image;
341 if (!image_skia.isNull()) { 342 if (!image_skia.isNull()) {
342 image_skia.MakeThreadSafe(); 343 image_skia.MakeThreadSafe();
343 image = gfx::Image(image_skia); 344 image = gfx::Image(image_skia);
344 } 345 }
345 346
346 callback.Run(image); 347 callback.Run(image);
347 } 348 }
348 349
349 } // namespace extensions 350 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/favicon/favicon_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698