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

Side by Side Diff: chrome/browser/sync/test/integration/bookmarks_helper.cc

Issue 335233003: Convert ui::ScaleFactor -> float in favicon/history code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix size_t Created 6 years, 6 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/sync/test/integration/bookmarks_helper.h" 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 int CountFoldersWithTitlesMatching(int profile, const std::string& title) { 762 int CountFoldersWithTitlesMatching(int profile, const std::string& title) {
763 return CountNodesWithTitlesMatching(GetBookmarkModel(profile), 763 return CountNodesWithTitlesMatching(GetBookmarkModel(profile),
764 BookmarkNode::FOLDER, 764 BookmarkNode::FOLDER,
765 base::UTF8ToUTF16(title)); 765 base::UTF8ToUTF16(title));
766 } 766 }
767 767
768 gfx::Image CreateFavicon(SkColor color) { 768 gfx::Image CreateFavicon(SkColor color) {
769 const int dip_width = 16; 769 const int dip_width = 16;
770 const int dip_height = 16; 770 const int dip_height = 16;
771 std::vector<ui::ScaleFactor> favicon_scale_factors = 771 std::vector<float> favicon_scales = favicon_base::GetFaviconScales();
772 favicon_base::GetFaviconScaleFactors();
773 gfx::ImageSkia favicon; 772 gfx::ImageSkia favicon;
774 for (size_t i = 0; i < favicon_scale_factors.size(); ++i) { 773 for (size_t i = 0; i < favicon_scales.size(); ++i) {
775 float scale = ui::GetScaleForScaleFactor(favicon_scale_factors[i]); 774 float scale = favicon_scales[i];
776 int pixel_width = dip_width * scale; 775 int pixel_width = dip_width * scale;
777 int pixel_height = dip_height * scale; 776 int pixel_height = dip_height * scale;
778 SkBitmap bmp; 777 SkBitmap bmp;
779 bmp.setConfig(SkBitmap::kARGB_8888_Config, pixel_width, pixel_height); 778 bmp.setConfig(SkBitmap::kARGB_8888_Config, pixel_width, pixel_height);
780 bmp.allocPixels(); 779 bmp.allocPixels();
781 bmp.eraseColor(color); 780 bmp.eraseColor(color);
782 favicon.AddRepresentation(gfx::ImageSkiaRep(bmp, scale)); 781 favicon.AddRepresentation(gfx::ImageSkiaRep(bmp, scale));
783 } 782 }
784 return gfx::Image(favicon); 783 return gfx::Image(favicon);
785 } 784 }
(...skipping 28 matching lines...) Expand all
814 813
815 std::string IndexedSubfolderName(int i) { 814 std::string IndexedSubfolderName(int i) {
816 return base::StringPrintf("Subfolder Name %d", i); 815 return base::StringPrintf("Subfolder Name %d", i);
817 } 816 }
818 817
819 std::string IndexedSubsubfolderName(int i) { 818 std::string IndexedSubsubfolderName(int i) {
820 return base::StringPrintf("Subsubfolder Name %d", i); 819 return base::StringPrintf("Subsubfolder Name %d", i);
821 } 820 }
822 821
823 } // namespace bookmarks_helper 822 } // namespace bookmarks_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698