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

Unified Diff: ui/gfx/icon_util.h

Issue 14839008: Move .ico hashing to icon_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forward declare md5 stuff Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/icon_util.h
diff --git a/ui/gfx/icon_util.h b/ui/gfx/icon_util.h
index 7ce5606f525d0f7b92b6ceaef7158ca0e1dec360..61174bbf91c80bd24f4fe5d2fec3301e18bd7d43 100644
--- a/ui/gfx/icon_util.h
+++ b/ui/gfx/icon_util.h
@@ -18,6 +18,7 @@
namespace base {
class FilePath;
+struct MD5Digest;
}
namespace gfx {
@@ -136,6 +137,19 @@ class UI_EXPORT IconUtil {
const void* dib_bits,
size_t dib_size);
+ // Calculates checksum of an icon family using MD5.
+ // The checksum is derived from all of the icons in the family.
+ static void GetImageCheckSum(const gfx::ImageFamily& image,
+ base::MD5Digest* digest);
Alexei Svitkine (slow) 2013/05/09 15:34:57 Can this be private to the implementation, in an a
+
+ // Saves |image| as an |icon_file| with the checksum.
Alexei Svitkine (slow) 2013/05/09 15:34:57 Please expand the comment to mention how this actu
+ static bool SaveIconWithCheckSum(const base::FilePath& icon_file,
+ const gfx::ImageFamily& image);
+
+ // Returns true if |icon_file| is missing or different from |image|.
+ static bool ShouldUpdateIcon(const base::FilePath& icon_file,
Alexei Svitkine (slow) 2013/05/09 15:34:57 Could you write a simple unit test for this?
+ const gfx::ImageFamily& image);
+
private:
// The icon format is published in the MSDN but there is no definition of
// the icon file structures in any of the Windows header files so we need to

Powered by Google App Engine
This is Rietveld 408576698