| 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 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
| 6 #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 6 #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // "unknown" if unknown. This value will not be modified by "-m" for a | 159 // "unknown" if unknown. This value will not be modified by "-m" for a |
| 160 // multi-install. See kChromeChannel* in util_constants.h | 160 // multi-install. See kChromeChannel* in util_constants.h |
| 161 static std::wstring GetChromeChannel(bool system_install); | 161 static std::wstring GetChromeChannel(bool system_install); |
| 162 | 162 |
| 163 // Return a human readable modifier for the version string, e.g. | 163 // Return a human readable modifier for the version string, e.g. |
| 164 // the channel (dev, beta, stable). Returns true if this operation succeeded, | 164 // the channel (dev, beta, stable). Returns true if this operation succeeded, |
| 165 // on success, channel contains one of "", "unknown", "dev" or "beta" (unless | 165 // on success, channel contains one of "", "unknown", "dev" or "beta" (unless |
| 166 // it is a multi-install product, in which case it will return "m", | 166 // it is a multi-install product, in which case it will return "m", |
| 167 // "unknown-m", "dev-m", or "beta-m"). | 167 // "unknown-m", "dev-m", or "beta-m"). |
| 168 static bool GetChromeChannelAndModifiers(bool system_install, | 168 static bool GetChromeChannelAndModifiers(bool system_install, |
| 169 string16* channel); | 169 base::string16* channel); |
| 170 | 170 |
| 171 // This method changes the Google Update "ap" value to move the installation | 171 // This method changes the Google Update "ap" value to move the installation |
| 172 // on to or off of one of the recovery channels. | 172 // on to or off of one of the recovery channels. |
| 173 // - If incremental installer fails we append a magic string ("-full"), if | 173 // - If incremental installer fails we append a magic string ("-full"), if |
| 174 // it is not present already, so that Google Update server next time will send | 174 // it is not present already, so that Google Update server next time will send |
| 175 // full installer to update Chrome on the local machine | 175 // full installer to update Chrome on the local machine |
| 176 // - If we are currently running full installer, we remove this magic | 176 // - If we are currently running full installer, we remove this magic |
| 177 // string (if it is present) regardless of whether installer failed or not. | 177 // string (if it is present) regardless of whether installer failed or not. |
| 178 // There is no fall-back for full installer :) | 178 // There is no fall-back for full installer :) |
| 179 // - Unconditionally remove "-multifail" since we haven't crashed. | 179 // - Unconditionally remove "-multifail" since we haven't crashed. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 const std::wstring& value); | 222 const std::wstring& value); |
| 223 | 223 |
| 224 // Returns the effective update policy for |app_guid| as dictated by | 224 // Returns the effective update policy for |app_guid| as dictated by |
| 225 // Group Policy settings. |is_overridden|, if non-NULL, is populated with | 225 // Group Policy settings. |is_overridden|, if non-NULL, is populated with |
| 226 // true if an app-specific policy override is in force, or false otherwise. | 226 // true if an app-specific policy override is in force, or false otherwise. |
| 227 static UpdatePolicy GetAppUpdatePolicy(const std::wstring& app_guid, | 227 static UpdatePolicy GetAppUpdatePolicy(const std::wstring& app_guid, |
| 228 bool* is_overridden); | 228 bool* is_overridden); |
| 229 | 229 |
| 230 // Returns Google Update's uninstall command line, or an empty string if none | 230 // Returns Google Update's uninstall command line, or an empty string if none |
| 231 // is found. | 231 // is found. |
| 232 static string16 GetUninstallCommandLine(bool system_install); | 232 static base::string16 GetUninstallCommandLine(bool system_install); |
| 233 | 233 |
| 234 // Returns the version of Google Update that is installed. | 234 // Returns the version of Google Update that is installed. |
| 235 static Version GetGoogleUpdateVersion(bool system_install); | 235 static Version GetGoogleUpdateVersion(bool system_install); |
| 236 | 236 |
| 237 // Returns the time at which Google Update last started an automatic update | 237 // Returns the time at which Google Update last started an automatic update |
| 238 // check, or the null time if this information isn't available. | 238 // check, or the null time if this information isn't available. |
| 239 static base::Time GetGoogleUpdateLastStartedAU(bool system_install); | 239 static base::Time GetGoogleUpdateLastStartedAU(bool system_install); |
| 240 | 240 |
| 241 // Returns the time at which Google Update last successfully contacted Google | 241 // Returns the time at which Google Update last successfully contacted Google |
| 242 // servers and got a valid check response, or the null time if this | 242 // servers and got a valid check response, or the null time if this |
| (...skipping 16 matching lines...) Expand all Loading... |
| 259 // GetUpdateDetailForApp with the app guid stored in BrowserDistribution.) | 259 // GetUpdateDetailForApp with the app guid stored in BrowserDistribution.) |
| 260 static bool GetUpdateDetail(bool system_install, ProductData* data); | 260 static bool GetUpdateDetail(bool system_install, ProductData* data); |
| 261 | 261 |
| 262 // Sets |experiment_labels| as the Google Update experiment_labels value in | 262 // Sets |experiment_labels| as the Google Update experiment_labels value in |
| 263 // the ClientState key for this Chrome product, if appropriate. If | 263 // the ClientState key for this Chrome product, if appropriate. If |
| 264 // |experiment_labels| is empty, this will delete the value instead. This will | 264 // |experiment_labels| is empty, this will delete the value instead. This will |
| 265 // return true if the label was successfully set (or deleted), false otherwise | 265 // return true if the label was successfully set (or deleted), false otherwise |
| 266 // (even if the label does not need to be set for this particular distribution | 266 // (even if the label does not need to be set for this particular distribution |
| 267 // type). | 267 // type). |
| 268 static bool SetExperimentLabels(bool system_install, | 268 static bool SetExperimentLabels(bool system_install, |
| 269 const string16& experiment_labels); | 269 const base::string16& experiment_labels); |
| 270 | 270 |
| 271 // Reads the Google Update experiment_labels value in the ClientState key for | 271 // Reads the Google Update experiment_labels value in the ClientState key for |
| 272 // this Chrome product and writes it into |experiment_labels|. If the key or | 272 // this Chrome product and writes it into |experiment_labels|. If the key or |
| 273 // value does not exist, |experiment_labels| will be set to the empty string. | 273 // value does not exist, |experiment_labels| will be set to the empty string. |
| 274 // If this distribution of Chrome does not set the experiment_labels value, | 274 // If this distribution of Chrome does not set the experiment_labels value, |
| 275 // this will do nothing to |experiment_labels|. This will return true if the | 275 // this will do nothing to |experiment_labels|. This will return true if the |
| 276 // label did not exist, or was successfully read. | 276 // label did not exist, or was successfully read. |
| 277 static bool ReadExperimentLabels(bool system_install, | 277 static bool ReadExperimentLabels(bool system_install, |
| 278 string16* experiment_labels); | 278 base::string16* experiment_labels); |
| 279 | 279 |
| 280 private: | 280 private: |
| 281 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 281 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
| 282 }; | 282 }; |
| 283 | 283 |
| 284 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 284 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
| OLD | NEW |