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

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

Issue 105823009: Revert 239280 "Move more file_util functions to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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
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_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
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) != base::ReadFile(checksum_file, 84 if (sizeof(persisted_image_checksum) != file_util::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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698