| 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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 SkBitmap bmp; | 922 SkBitmap bmp; |
| 923 bmp.allocN32Pixels(pixel_width, pixel_height); | 923 bmp.allocN32Pixels(pixel_width, pixel_height); |
| 924 bmp.eraseColor(color); | 924 bmp.eraseColor(color); |
| 925 favicon.AddRepresentation(gfx::ImageSkiaRep(bmp, scale)); | 925 favicon.AddRepresentation(gfx::ImageSkiaRep(bmp, scale)); |
| 926 } | 926 } |
| 927 return gfx::Image(favicon); | 927 return gfx::Image(favicon); |
| 928 } | 928 } |
| 929 | 929 |
| 930 gfx::Image Create1xFaviconFromPNGFile(const std::string& path) { | 930 gfx::Image Create1xFaviconFromPNGFile(const std::string& path) { |
| 931 const char* kPNGExtension = ".png"; | 931 const char* kPNGExtension = ".png"; |
| 932 if (!EndsWith(path, kPNGExtension, false)) | 932 if (!base::EndsWith(path, kPNGExtension, false)) |
| 933 return gfx::Image(); | 933 return gfx::Image(); |
| 934 | 934 |
| 935 base::FilePath full_path; | 935 base::FilePath full_path; |
| 936 if (!PathService::Get(chrome::DIR_TEST_DATA, &full_path)) | 936 if (!PathService::Get(chrome::DIR_TEST_DATA, &full_path)) |
| 937 return gfx::Image(); | 937 return gfx::Image(); |
| 938 | 938 |
| 939 full_path = full_path.AppendASCII("sync").AppendASCII(path); | 939 full_path = full_path.AppendASCII("sync").AppendASCII(path); |
| 940 std::string contents; | 940 std::string contents; |
| 941 base::ReadFileToString(full_path, &contents); | 941 base::ReadFileToString(full_path, &contents); |
| 942 return gfx::Image::CreateFrom1xPNGBytes( | 942 return gfx::Image::CreateFrom1xPNGBytes( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 957 | 957 |
| 958 std::string IndexedSubfolderName(int i) { | 958 std::string IndexedSubfolderName(int i) { |
| 959 return base::StringPrintf("Subfolder Name %d", i); | 959 return base::StringPrintf("Subfolder Name %d", i); |
| 960 } | 960 } |
| 961 | 961 |
| 962 std::string IndexedSubsubfolderName(int i) { | 962 std::string IndexedSubsubfolderName(int i) { |
| 963 return base::StringPrintf("Subsubfolder Name %d", i); | 963 return base::StringPrintf("Subsubfolder Name %d", i); |
| 964 } | 964 } |
| 965 | 965 |
| 966 } // namespace bookmarks_helper | 966 } // namespace bookmarks_helper |
| OLD | NEW |