| 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, | 967 if (!base::EndsWith(path, kPNGExtension, false)) |
| 968 base::CompareCase::INSENSITIVE_ASCII)) | |
| 969 return gfx::Image(); | 968 return gfx::Image(); |
| 970 | 969 |
| 971 base::FilePath full_path; | 970 base::FilePath full_path; |
| 972 if (!PathService::Get(chrome::DIR_TEST_DATA, &full_path)) | 971 if (!PathService::Get(chrome::DIR_TEST_DATA, &full_path)) |
| 973 return gfx::Image(); | 972 return gfx::Image(); |
| 974 | 973 |
| 975 full_path = full_path.AppendASCII("sync").AppendASCII(path); | 974 full_path = full_path.AppendASCII("sync").AppendASCII(path); |
| 976 std::string contents; | 975 std::string contents; |
| 977 base::ReadFileToString(full_path, &contents); | 976 base::ReadFileToString(full_path, &contents); |
| 978 return gfx::Image::CreateFrom1xPNGBytes( | 977 return gfx::Image::CreateFrom1xPNGBytes( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 993 | 992 |
| 994 std::string IndexedSubfolderName(int i) { | 993 std::string IndexedSubfolderName(int i) { |
| 995 return base::StringPrintf("Subfolder Name %d", i); | 994 return base::StringPrintf("Subfolder Name %d", i); |
| 996 } | 995 } |
| 997 | 996 |
| 998 std::string IndexedSubsubfolderName(int i) { | 997 std::string IndexedSubsubfolderName(int i) { |
| 999 return base::StringPrintf("Subsubfolder Name %d", i); | 998 return base::StringPrintf("Subsubfolder Name %d", i); |
| 1000 } | 999 } |
| 1001 | 1000 |
| 1002 } // namespace bookmarks_helper | 1001 } // namespace bookmarks_helper |
| OLD | NEW |