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 enum UpdatePolicy { |
| 25 UPDATES_DISABLED, |
| 26 AUTOMATIC_UPDATES, |
| 27 MANUAL_UPDATES_ONLY, |
| 28 }; |
| 29 COMPILE_ASSERT(GoogleUpdateSettings::UPDATES_DISABLED == 0, |
| 30 dont_reorder_GoogleUpdateSettings_UpdatePolicy); |
| 31 COMPILE_ASSERT(GoogleUpdateSettings::AUTOMATIC_UPDATES == 1, |
| 32 dont_reorder_GoogleUpdateSettings_UpdatePolicy); |
| 33 COMPILE_ASSERT(GoogleUpdateSettings::MANUAL_UPDATES_ONLY == 2, |
| 34 dont_reorder_GoogleUpdateSettings_UpdatePolicy); |
| 35 |
24 // Returns whether the user has given consent to collect UMA data and send | 36 // 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 | 37 // crash dumps to Google. This information is collected by the web server |
26 // used to download the chrome installer. | 38 // used to download the chrome installer. |
27 static bool GetCollectStatsConsent(); | 39 static bool GetCollectStatsConsent(); |
28 | 40 |
29 // Sets the user consent to send UMA and crash dumps to Google. Returns | 41 // Sets the user consent to send UMA and crash dumps to Google. Returns |
30 // false if the setting could not be recorded. | 42 // false if the setting could not be recorded. |
31 static bool SetCollectStatsConsent(bool consented); | 43 static bool SetCollectStatsConsent(bool consented); |
32 | 44 |
33 // Returns the metrics id set in the registry (that can be used in crash | 45 // 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); | 165 const std::wstring& value); |
154 | 166 |
155 // True if a build is strictly organic, according to its brand code. | 167 // True if a build is strictly organic, according to its brand code. |
156 static bool IsOrganic(const std::wstring& brand); | 168 static bool IsOrganic(const std::wstring& brand); |
157 | 169 |
158 // True if a build should run as organic in the first run process. This uses | 170 // 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 | 171 // a slightly different set of brand codes from the standard IsOrganic |
160 // method. | 172 // method. |
161 static bool IsOrganicFirstRun(const std::wstring& brand); | 173 static bool IsOrganicFirstRun(const std::wstring& brand); |
162 | 174 |
| 175 // Returns the effective update policy for |app_guid| as dictated by |
| 176 // Group Policy settings. |is_overridden|, if non-NULL, is populated with |
| 177 // true if an app-specific policy override is in force, or false otherwise. |
| 178 static UpdatePolicy GetAppUpdatePolicy(const std::wstring& app_guid, |
| 179 bool* is_overridden); |
| 180 |
163 private: | 181 private: |
164 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 182 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
165 }; | 183 }; |
166 | 184 |
167 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 185 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
OLD | NEW |