| 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/web_applications/web_app_win.h" | 5 #include "chrome/browser/web_applications/web_app_win.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 const gfx::ImageFamily& image) { | 74 const gfx::ImageFamily& image) { |
| 75 base::FilePath checksum_file( | 75 base::FilePath checksum_file( |
| 76 icon_file.ReplaceExtension(kIconChecksumFileExt)); | 76 icon_file.ReplaceExtension(kIconChecksumFileExt)); |
| 77 | 77 |
| 78 // Returns true if icon_file or checksum file is missing. | 78 // Returns true if icon_file or checksum file is missing. |
| 79 if (!base::PathExists(icon_file) || | 79 if (!base::PathExists(icon_file) || |
| 80 !base::PathExists(checksum_file)) | 80 !base::PathExists(checksum_file)) |
| 81 return true; | 81 return true; |
| 82 | 82 |
| 83 base::MD5Digest persisted_image_checksum; | 83 base::MD5Digest persisted_image_checksum; |
| 84 if (sizeof(persisted_image_checksum) != file_util::ReadFile(checksum_file, | 84 if (sizeof(persisted_image_checksum) != base::ReadFile(checksum_file, |
| 85 reinterpret_cast<char*>(&persisted_image_checksum), | 85 reinterpret_cast<char*>(&persisted_image_checksum), |
| 86 sizeof(persisted_image_checksum))) | 86 sizeof(persisted_image_checksum))) |
| 87 return true; | 87 return true; |
| 88 | 88 |
| 89 base::MD5Digest downloaded_image_checksum; | 89 base::MD5Digest downloaded_image_checksum; |
| 90 GetImageCheckSum(image, &downloaded_image_checksum); | 90 GetImageCheckSum(image, &downloaded_image_checksum); |
| 91 | 91 |
| 92 // Update icon if checksums are not equal. | 92 // Update icon if checksums are not equal. |
| 93 return memcmp(&persisted_image_checksum, &downloaded_image_checksum, | 93 return memcmp(&persisted_image_checksum, &downloaded_image_checksum, |
| 94 sizeof(base::MD5Digest)) != 0; | 94 sizeof(base::MD5Digest)) != 0; |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 531 } |
| 532 shortcut_paths.push_back(path); | 532 shortcut_paths.push_back(path); |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 return shortcut_paths; | 535 return shortcut_paths; |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace internals | 538 } // namespace internals |
| 539 | 539 |
| 540 } // namespace web_app | 540 } // namespace web_app |
| OLD | NEW |