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

Side by Side Diff: chrome/installer/util/install_util.h

Issue 1986823002: Reset user data directory and disk cache directory after downgrade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « chrome/installer/setup/install_worker.cc ('k') | chrome/installer/util/install_util.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) 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 // This file declares utility functions for the installer. The original reason 5 // This file declares utility functions for the installer. The original reason
6 // for putting these functions in installer\util library is so that we can 6 // for putting these functions in installer\util library is so that we can
7 // separate out the critical logic and write unit tests for it. 7 // separate out the critical logic and write unit tests for it.
8 8
9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ 9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ 10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 static int GetInstallReturnCode(installer::InstallStatus install_status); 176 static int GetInstallReturnCode(installer::InstallStatus install_status);
177 177
178 // Composes |program| and |arguments| into |command_line|. 178 // Composes |program| and |arguments| into |command_line|.
179 static void ComposeCommandLine(const base::string16& program, 179 static void ComposeCommandLine(const base::string16& program,
180 const base::string16& arguments, 180 const base::string16& arguments,
181 base::CommandLine* command_line); 181 base::CommandLine* command_line);
182 182
183 // Returns a string in the form YYYYMMDD of the current date. 183 // Returns a string in the form YYYYMMDD of the current date.
184 static base::string16 GetCurrentDate(); 184 static base::string16 GetCurrentDate();
185 185
186 // Returns the highest Chrome version that was installed prior to a downgrade,
187 // or an invalid Version if Chrome was not previously downgraded from a newer
188 // version.
189 static base::Version GetDowngradeVersion(bool system_install,
190 const BrowserDistribution* dist);
191
192 // Adds or removes downgrade version registry value. This function should only
193 // be used for Chrome install.
194 static void AddUpdateDowngradeVersionItem(
195 bool system_install,
196 const base::Version* current_version,
197 const base::Version& new_version,
198 const BrowserDistribution* dist,
199 WorkItemList* list);
200
186 // A predicate that compares the program portion of a command line with a 201 // A predicate that compares the program portion of a command line with a
187 // given file path. First, the file paths are compared directly. If they do 202 // given file path. First, the file paths are compared directly. If they do
188 // not match, the filesystem is consulted to determine if the paths reference 203 // not match, the filesystem is consulted to determine if the paths reference
189 // the same file. 204 // the same file.
190 class ProgramCompare : public RegistryValuePredicate { 205 class ProgramCompare : public RegistryValuePredicate {
191 public: 206 public:
192 enum class ComparisonType { 207 enum class ComparisonType {
193 // Evaluation compares existing files. 208 // Evaluation compares existing files.
194 FILE, 209 FILE,
195 // Evaluation compares existing files or directories. 210 // Evaluation compares existing files or directories.
(...skipping 26 matching lines...) Expand all
222 private: 237 private:
223 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); 238 DISALLOW_COPY_AND_ASSIGN(ProgramCompare);
224 }; // class ProgramCompare 239 }; // class ProgramCompare
225 240
226 private: 241 private:
227 DISALLOW_COPY_AND_ASSIGN(InstallUtil); 242 DISALLOW_COPY_AND_ASSIGN(InstallUtil);
228 }; 243 };
229 244
230 245
231 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ 246 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/installer/setup/install_worker.cc ('k') | chrome/installer/util/install_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698