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

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

Issue 11280067: Refactor SetOmahaExperimentLabel out of gcpai and into install_util. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 1 month 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
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 static int GetInstallReturnCode(installer::InstallStatus install_status); 168 static int GetInstallReturnCode(installer::InstallStatus install_status);
169 169
170 // Composes |program| and |arguments| into |command_line|. 170 // Composes |program| and |arguments| into |command_line|.
171 static void MakeUninstallCommand(const string16& program, 171 static void MakeUninstallCommand(const string16& program,
172 const string16& arguments, 172 const string16& arguments,
173 CommandLine* command_line); 173 CommandLine* command_line);
174 174
175 // Returns a string in the form YYYYMMDD of the current date. 175 // Returns a string in the form YYYYMMDD of the current date.
176 static string16 GetCurrentDate(); 176 static string16 GetCurrentDate();
177 177
178 // Sets |experiment_label| as the Omaha experiment_labels value in the
179 // ClientState key for this Chrome product. If |system_install| is true, this
grt (UTC plus 2) 2012/11/24 02:58:37 The HKLM/HKCU part of the comment is a bit superfl
SteveT 2012/11/26 20:45:06 K, removed.
180 // will write to HKLM, otherwise it will write to HKCU. This will return true
181 // if the label was successfully written, false otherwise (even if the label
grt (UTC plus 2) 2012/11/24 02:58:37 I think it's less ambiguous from the standpoint of
SteveT 2012/11/26 20:45:06 GCAPI doesn't seem to care at all what the result
grt (UTC plus 2) 2012/11/26 21:19:05 In the installer, we make heavy use of LOG(foo) an
182 // does not need to be written for this particular distribution type).
183 static bool SetOmahaExperimentLabel(const string16& experiment_label,
grt (UTC plus 2) 2012/11/24 02:58:37 I think it's more consistent with the surrounding
SteveT 2012/11/26 20:45:06 Done.
184 bool system_install);
185
178 // A predicate that compares the program portion of a command line with a 186 // A predicate that compares the program portion of a command line with a
179 // given file path. First, the file paths are compared directly. If they do 187 // given file path. First, the file paths are compared directly. If they do
180 // not match, the filesystem is consulted to determine if the paths reference 188 // not match, the filesystem is consulted to determine if the paths reference
181 // the same file. 189 // the same file.
182 class ProgramCompare : public RegistryValuePredicate { 190 class ProgramCompare : public RegistryValuePredicate {
183 public: 191 public:
184 explicit ProgramCompare(const FilePath& path_to_match); 192 explicit ProgramCompare(const FilePath& path_to_match);
185 virtual ~ProgramCompare(); 193 virtual ~ProgramCompare();
186 virtual bool Evaluate(const string16& value) const OVERRIDE; 194 virtual bool Evaluate(const string16& value) const OVERRIDE;
187 195
(...skipping 10 matching lines...) Expand all
198 private: 206 private:
199 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); 207 DISALLOW_COPY_AND_ASSIGN(ProgramCompare);
200 }; // class ProgramCompare 208 }; // class ProgramCompare
201 209
202 private: 210 private:
203 DISALLOW_COPY_AND_ASSIGN(InstallUtil); 211 DISALLOW_COPY_AND_ASSIGN(InstallUtil);
204 }; 212 };
205 213
206 214
207 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ 215 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698