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

Unified Diff: chrome/browser/ui/app_list/fast_show_pickler.cc

Issue 24707002: Add unit tests for AppListServiceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: un-const an iterator 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/fast_show_pickler.cc
diff --git a/chrome/browser/ui/app_list/fast_show_pickler.cc b/chrome/browser/ui/app_list/fast_show_pickler.cc
index d282aabfc2be6197f303ac7a5cff82afb47ee534..d98b5fbf4f0bb87651657bb574e17d807680c39e 100644
--- a/chrome/browser/ui/app_list/fast_show_pickler.cc
+++ b/chrome/browser/ui/app_list/fast_show_pickler.cc
@@ -6,7 +6,6 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/app_list/app_list_item_model.h"
-#include "ui/base/layout.h"
#include "ui/gfx/image/image_skia_rep.h"
namespace {
@@ -88,7 +87,7 @@ bool PickleImage(Pickle* pickle, const gfx::ImageSkia& image) {
pickle->WriteInt(static_cast<int>(reps.size()));
for (std::vector<gfx::ImageSkiaRep>::const_iterator it = reps.begin();
it != reps.end(); ++it) {
- pickle->WriteInt(static_cast<int>(ui::GetSupportedScaleFactor(it->scale())));
+ pickle->WriteFloat(it->scale());
pickle->WriteInt(it->pixel_width());
pickle->WriteInt(it->pixel_height());
ImageFormat format = NONE;
@@ -111,8 +110,8 @@ bool UnpickleImage(PickleIterator* it, gfx::ImageSkia* out) {
gfx::ImageSkia result;
for (int i = 0; i < rep_count; ++i) {
- int scale_factor = 0;
- if (!it->ReadInt(&scale_factor))
+ float scale = 0.0f;
+ if (!it->ReadFloat(&scale))
return false;
int width = 0;
@@ -147,7 +146,6 @@ bool UnpickleImage(PickleIterator* it, gfx::ImageSkia* out) {
SkAutoLockPixels lock(bitmap);
memcpy(bitmap.getPixels(), pixels, bitmap.getSize());
}
- float scale = ui::GetImageScale(static_cast<ui::ScaleFactor>(scale_factor));
result.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale));
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_unittest.cc ('k') | chrome/browser/ui/app_list/keep_alive_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698