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/sync/test/integration/bookmarks_helper.h" | 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 SkBitmap bmp; | 957 SkBitmap bmp; |
958 bmp.allocN32Pixels(pixel_width, pixel_height); | 958 bmp.allocN32Pixels(pixel_width, pixel_height); |
959 bmp.eraseColor(color); | 959 bmp.eraseColor(color); |
960 favicon.AddRepresentation(gfx::ImageSkiaRep(bmp, scale)); | 960 favicon.AddRepresentation(gfx::ImageSkiaRep(bmp, scale)); |
961 } | 961 } |
962 return gfx::Image(favicon); | 962 return gfx::Image(favicon); |
963 } | 963 } |
964 | 964 |
965 gfx::Image Create1xFaviconFromPNGFile(const std::string& path) { | 965 gfx::Image Create1xFaviconFromPNGFile(const std::string& path) { |
966 const char* kPNGExtension = ".png"; | 966 const char* kPNGExtension = ".png"; |
967 if (!base::EndsWith(path, kPNGExtension, false)) | 967 if (!base::EndsWith(path, kPNGExtension, |
| 968 base::CompareCase::INSENSITIVE_ASCII)) |
968 return gfx::Image(); | 969 return gfx::Image(); |
969 | 970 |
970 base::FilePath full_path; | 971 base::FilePath full_path; |
971 if (!PathService::Get(chrome::DIR_TEST_DATA, &full_path)) | 972 if (!PathService::Get(chrome::DIR_TEST_DATA, &full_path)) |
972 return gfx::Image(); | 973 return gfx::Image(); |
973 | 974 |
974 full_path = full_path.AppendASCII("sync").AppendASCII(path); | 975 full_path = full_path.AppendASCII("sync").AppendASCII(path); |
975 std::string contents; | 976 std::string contents; |
976 base::ReadFileToString(full_path, &contents); | 977 base::ReadFileToString(full_path, &contents); |
977 return gfx::Image::CreateFrom1xPNGBytes( | 978 return gfx::Image::CreateFrom1xPNGBytes( |
(...skipping 14 matching lines...) Expand all Loading... |
992 | 993 |
993 std::string IndexedSubfolderName(int i) { | 994 std::string IndexedSubfolderName(int i) { |
994 return base::StringPrintf("Subfolder Name %d", i); | 995 return base::StringPrintf("Subfolder Name %d", i); |
995 } | 996 } |
996 | 997 |
997 std::string IndexedSubsubfolderName(int i) { | 998 std::string IndexedSubsubfolderName(int i) { |
998 return base::StringPrintf("Subsubfolder Name %d", i); | 999 return base::StringPrintf("Subsubfolder Name %d", i); |
999 } | 1000 } |
1000 | 1001 |
1001 } // namespace bookmarks_helper | 1002 } // namespace bookmarks_helper |
OLD | NEW |