OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "chrome/installer/util/util_constants.h" | 12 #include "chrome/installer/util/util_constants.h" |
13 | 13 |
14 namespace installer { | 14 namespace installer { |
15 class ChannelInfo; | 15 class ChannelInfo; |
16 class InstallerState; | 16 class InstallerState; |
17 } | 17 } |
18 | 18 |
19 // This class provides accessors to the Google Update 'ClientState' information | 19 // This class provides accessors to the Google Update 'ClientState' information |
20 // that recorded when the user downloads the chrome installer. It is | 20 // that recorded when the user downloads the chrome installer. It is |
21 // google_update.exe responsability to write the initial values. | 21 // google_update.exe responsability to write the initial values. |
22 class GoogleUpdateSettings { | 22 class GoogleUpdateSettings { |
23 public: | 23 public: |
| 24 // Update policy constants defined by Google Update; do not change these. |
| 25 enum UpdatePolicy { |
| 26 UPDATES_DISABLED = 0, |
| 27 AUTOMATIC_UPDATES = 1, |
| 28 MANUAL_UPDATES_ONLY = 2, |
| 29 }; |
| 30 |
24 // Returns whether the user has given consent to collect UMA data and send | 31 // Returns whether the user has given consent to collect UMA data and send |
25 // crash dumps to Google. This information is collected by the web server | 32 // crash dumps to Google. This information is collected by the web server |
26 // used to download the chrome installer. | 33 // used to download the chrome installer. |
27 static bool GetCollectStatsConsent(); | 34 static bool GetCollectStatsConsent(); |
28 | 35 |
29 // Sets the user consent to send UMA and crash dumps to Google. Returns | 36 // Sets the user consent to send UMA and crash dumps to Google. Returns |
30 // false if the setting could not be recorded. | 37 // false if the setting could not be recorded. |
31 static bool SetCollectStatsConsent(bool consented); | 38 static bool SetCollectStatsConsent(bool consented); |
32 | 39 |
33 // Returns the metrics id set in the registry (that can be used in crash | 40 // Returns the metrics id set in the registry (that can be used in crash |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const std::wstring& value); | 160 const std::wstring& value); |
154 | 161 |
155 // True if a build is strictly organic, according to its brand code. | 162 // True if a build is strictly organic, according to its brand code. |
156 static bool IsOrganic(const std::wstring& brand); | 163 static bool IsOrganic(const std::wstring& brand); |
157 | 164 |
158 // True if a build should run as organic in the first run process. This uses | 165 // True if a build should run as organic in the first run process. This uses |
159 // a slightly different set of brand codes from the standard IsOrganic | 166 // a slightly different set of brand codes from the standard IsOrganic |
160 // method. | 167 // method. |
161 static bool IsOrganicFirstRun(const std::wstring& brand); | 168 static bool IsOrganicFirstRun(const std::wstring& brand); |
162 | 169 |
| 170 // Returns the effective update policy for |app_guid| as dictated by |
| 171 // Group Policy settings. |is_overridden|, if non-NULL, is populated with |
| 172 // true if an app-specific policy override is in force, or false otherwise. |
| 173 static UpdatePolicy GetAppUpdatePolicy(const std::wstring& app_guid, |
| 174 bool* is_overridden); |
| 175 |
163 private: | 176 private: |
164 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 177 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
165 }; | 178 }; |
166 | 179 |
167 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 180 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
OLD | NEW |