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

Side by Side Diff: chrome/browser/web_applications/web_app_win.cc

Issue 11742007: Add support for adding 256x256 pngs to Windows .ico files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_win.cc ('k') | ui/gfx/icon_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/web_applications/web_app.h" 5 #include "chrome/browser/web_applications/web_app.h"
6 6
7 #include <shlobj.h> 7 #include <shlobj.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 17 matching lines...) Expand all
28 // Calculates image checksum using MD5. 28 // Calculates image checksum using MD5.
29 void GetImageCheckSum(const SkBitmap& image, base::MD5Digest* digest) { 29 void GetImageCheckSum(const SkBitmap& image, base::MD5Digest* digest) {
30 DCHECK(digest); 30 DCHECK(digest);
31 31
32 SkAutoLockPixels image_lock(image); 32 SkAutoLockPixels image_lock(image);
33 MD5Sum(image.getPixels(), image.getSize(), digest); 33 MD5Sum(image.getPixels(), image.getSize(), digest);
34 } 34 }
35 35
36 // Saves |image| as an |icon_file| with the checksum. 36 // Saves |image| as an |icon_file| with the checksum.
37 bool SaveIconWithCheckSum(const FilePath& icon_file, const SkBitmap& image) { 37 bool SaveIconWithCheckSum(const FilePath& icon_file, const SkBitmap& image) {
38 if (!IconUtil::CreateIconFileFromSkBitmap(image, icon_file)) 38 if (!IconUtil::CreateIconFileFromSkBitmap(image, SkBitmap(), icon_file))
39 return false; 39 return false;
40 40
41 base::MD5Digest digest; 41 base::MD5Digest digest;
42 GetImageCheckSum(image, &digest); 42 GetImageCheckSum(image, &digest);
43 43
44 FilePath cheksum_file(icon_file.ReplaceExtension(kIconChecksumFileExt)); 44 FilePath cheksum_file(icon_file.ReplaceExtension(kIconChecksumFileExt));
45 return file_util::WriteFile(cheksum_file, 45 return file_util::WriteFile(cheksum_file,
46 reinterpret_cast<const char*>(&digest), 46 reinterpret_cast<const char*>(&digest),
47 sizeof(digest)) == sizeof(digest); 47 sizeof(digest)) == sizeof(digest);
48 } 48 }
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // they are all unpinned. 351 // they are all unpinned.
352 base::win::TaskbarUnpinShortcutLink(j->value().c_str()); 352 base::win::TaskbarUnpinShortcutLink(j->value().c_str());
353 file_util::Delete(*j, false); 353 file_util::Delete(*j, false);
354 } 354 }
355 } 355 }
356 } 356 }
357 357
358 } // namespace internals 358 } // namespace internals
359 359
360 } // namespace web_app 360 } // namespace web_app
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_win.cc ('k') | ui/gfx/icon_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698