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

Side by Side Diff: chrome/browser/extensions/extension_file_util.cc

Issue 165297: Replaces some TrimWhitespace with TrimWhitespaceASCII or TrimWhitespaceUTF8.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: hunspell fix Created 11 years, 4 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 | « base/string_util.cc ('k') | chrome/browser/extensions/user_script_master.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/extensions/extension_file_util.h" 5 #include "chrome/browser/extensions/extension_file_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 *error = "Couldn't create CurrentVersion file."; 73 *error = "Couldn't create CurrentVersion file.";
74 return false; 74 return false;
75 } 75 }
76 return true; 76 return true;
77 } 77 }
78 78
79 bool ReadCurrentVersion(const FilePath& dir, std::string* version_string) { 79 bool ReadCurrentVersion(const FilePath& dir, std::string* version_string) {
80 FilePath current_version = dir.AppendASCII(kCurrentVersionFileName); 80 FilePath current_version = dir.AppendASCII(kCurrentVersionFileName);
81 if (file_util::PathExists(current_version)) { 81 if (file_util::PathExists(current_version)) {
82 if (file_util::ReadFileToString(current_version, version_string)) { 82 if (file_util::ReadFileToString(current_version, version_string)) {
83 TrimWhitespace(*version_string, TRIM_ALL, version_string); 83 TrimWhitespaceASCII(*version_string, TRIM_ALL, version_string);
84 return true; 84 return true;
85 } 85 }
86 } 86 }
87 return false; 87 return false;
88 } 88 }
89 89
90 Extension::InstallType CompareToInstalledVersion( 90 Extension::InstallType CompareToInstalledVersion(
91 const FilePath& install_directory, const std::string& id, 91 const FilePath& install_directory, const std::string& id,
92 const std::string& new_version_str, std::string *current_version_str) { 92 const std::string& new_version_str, std::string *current_version_str) {
93 CHECK(current_version_str); 93 CHECK(current_version_str);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 "directory: " << extension_id; 343 "directory: " << extension_id;
344 LOG(INFO) << "Deleting invalid extension directory " 344 LOG(INFO) << "Deleting invalid extension directory "
345 << WideToASCII(extension_path.ToWStringHack()) << "."; 345 << WideToASCII(extension_path.ToWStringHack()) << ".";
346 file_util::Delete(extension_path, true); // Recursive. 346 file_util::Delete(extension_path, true); // Recursive.
347 continue; 347 continue;
348 } 348 }
349 } 349 }
350 } 350 }
351 351
352 } // extensionfile_util 352 } // extensionfile_util
OLDNEW
« no previous file with comments | « base/string_util.cc ('k') | chrome/browser/extensions/user_script_master.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698