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 class BrowserDistribution; |
| 15 |
14 namespace installer { | 16 namespace installer { |
15 class ChannelInfo; | 17 class ChannelInfo; |
16 class InstallationState; | 18 class InstallationState; |
17 } | 19 } |
18 | 20 |
19 // This class provides accessors to the Google Update 'ClientState' information | 21 // This class provides accessors to the Google Update 'ClientState' information |
20 // that recorded when the user downloads the chrome installer. It is | 22 // that recorded when the user downloads the chrome installer. It is |
21 // google_update.exe responsability to write the initial values. | 23 // google_update.exe responsibility to write the initial values. |
22 class GoogleUpdateSettings { | 24 class GoogleUpdateSettings { |
23 public: | 25 public: |
24 // Update policy constants defined by Google Update; do not change these. | 26 // Update policy constants defined by Google Update; do not change these. |
25 enum UpdatePolicy { | 27 enum UpdatePolicy { |
26 UPDATES_DISABLED = 0, | 28 UPDATES_DISABLED = 0, |
27 AUTOMATIC_UPDATES = 1, | 29 AUTOMATIC_UPDATES = 1, |
28 MANUAL_UPDATES_ONLY = 2, | 30 MANUAL_UPDATES_ONLY = 2, |
29 }; | 31 }; |
30 | 32 |
31 // Returns whether the user has given consent to collect UMA data and send | 33 // Returns whether the user has given consent to collect UMA data and send |
32 // crash dumps to Google. This information is collected by the web server | 34 // crash dumps to Google. This information is collected by the web server |
33 // used to download the chrome installer. | 35 // used to download the chrome installer. |
34 static bool GetCollectStatsConsent(); | 36 static bool GetCollectStatsConsent(); |
35 | 37 |
36 // Sets the user consent to send UMA and crash dumps to Google. Returns | 38 // Sets the user consent to send UMA and crash dumps to Google. Returns |
37 // false if the setting could not be recorded. | 39 // false if the setting could not be recorded. |
38 static bool SetCollectStatsConsent(bool consented); | 40 static bool SetCollectStatsConsent(bool consented); |
39 | 41 |
40 // Returns the metrics id set in the registry (that can be used in crash | 42 // Returns the metrics id set in the registry (that can be used in crash |
41 // reports). If none found, returns empty string. | 43 // reports). If none found, returns empty string. |
42 static bool GetMetricsId(std::wstring* metrics_id); | 44 static bool GetMetricsId(std::wstring* metrics_id); |
43 | 45 |
44 // Sets the metrics id to be used in crash reports. | 46 // Sets the metrics id to be used in crash reports. |
45 static bool SetMetricsId(const std::wstring& metrics_id); | 47 static bool SetMetricsId(const std::wstring& metrics_id); |
46 | 48 |
47 // Sets the machine-wide EULA consented flag required on OEM installs. | 49 // Sets the machine-wide EULA consented flag required on OEM installs. |
48 // Returns false if the setting could not be recorded. | 50 // Returns false if the setting could not be recorded. |
49 static bool SetEULAConsent(const installer::InstallationState& machine_state, | 51 static bool SetEULAConsent(const installer::InstallationState& machine_state, |
| 52 BrowserDistribution* dist, |
50 bool consented); | 53 bool consented); |
51 | 54 |
52 // Returns the last time chrome was run in days. It uses a recorded value | 55 // Returns the last time chrome was run in days. It uses a recorded value |
53 // set by SetLastRunTime(). Returns -1 if the value was not found or if | 56 // set by SetLastRunTime(). Returns -1 if the value was not found or if |
54 // the value is corrupted. | 57 // the value is corrupted. |
55 static int GetLastRunTime(); | 58 static int GetLastRunTime(); |
56 | 59 |
57 // Stores the time that this function was last called using an encoded | 60 // Stores the time that this function was last called using an encoded |
58 // form of the system local time. Retrieve the time using GetLastRunTime(). | 61 // form of the system local time. Retrieve the time using GetLastRunTime(). |
59 // Returns false if the value could not be stored. | 62 // Returns false if the value could not be stored. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // Group Policy settings. |is_overridden|, if non-NULL, is populated with | 179 // 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. | 180 // true if an app-specific policy override is in force, or false otherwise. |
178 static UpdatePolicy GetAppUpdatePolicy(const std::wstring& app_guid, | 181 static UpdatePolicy GetAppUpdatePolicy(const std::wstring& app_guid, |
179 bool* is_overridden); | 182 bool* is_overridden); |
180 | 183 |
181 private: | 184 private: |
182 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 185 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
183 }; | 186 }; |
184 | 187 |
185 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 188 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
OLD | NEW |