OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 12 |
13 namespace installer { | 13 namespace installer { |
14 class ChannelInfo; | 14 class ChannelInfo; |
15 class Package; | 15 class InstallerState; |
16 } | 16 } |
17 | 17 |
18 // This class provides accessors to the Google Update 'ClientState' information | 18 // This class provides accessors to the Google Update 'ClientState' information |
19 // that recorded when the user downloads the chrome installer. It is | 19 // that recorded when the user downloads the chrome installer. It is |
20 // google_update.exe responsability to write the initial values. | 20 // google_update.exe responsability to write the initial values. |
21 class GoogleUpdateSettings { | 21 class GoogleUpdateSettings { |
22 public: | 22 public: |
23 // Returns whether the user has given consent to collect UMA data and send | 23 // Returns whether the user has given consent to collect UMA data and send |
24 // crash dumps to Google. This information is collected by the web server | 24 // crash dumps to Google. This information is collected by the web server |
25 // used to download the chrome installer. | 25 // used to download the chrome installer. |
26 static bool GetCollectStatsConsent(); | 26 static bool GetCollectStatsConsent(); |
27 | 27 |
28 // Sets the user consent to send UMA and crash dumps to Google. Returns | 28 // Sets the user consent to send UMA and crash dumps to Google. Returns |
29 // false if the setting could not be recorded. | 29 // false if the setting could not be recorded. |
30 static bool SetCollectStatsConsent(bool consented); | 30 static bool SetCollectStatsConsent(bool consented); |
31 | 31 |
32 // Returns the metrics id set in the registry (that can be used in crash | 32 // Returns the metrics id set in the registry (that can be used in crash |
33 // reports). If none found, returns empty string. | 33 // reports). If none found, returns empty string. |
34 static bool GetMetricsId(std::wstring* metrics_id); | 34 static bool GetMetricsId(std::wstring* metrics_id); |
35 | 35 |
36 // Sets the metrics id to be used in crash reports. | 36 // Sets the metrics id to be used in crash reports. |
37 static bool SetMetricsId(const std::wstring& metrics_id); | 37 static bool SetMetricsId(const std::wstring& metrics_id); |
38 | 38 |
39 // Sets the machine-wide EULA consented flag required on OEM installs. | 39 // Sets the machine-wide EULA consented flag required on OEM installs. |
40 // Returns false if the setting could not be recorded. | 40 // Returns false if the setting could not be recorded. |
41 static bool SetEULAConsent(const installer::Package& package, | 41 static bool SetEULAConsent(const installer::InstallerState& installer_state, |
42 bool consented); | 42 bool consented); |
43 | 43 |
44 // Returns the last time chrome was run in days. It uses a recorded value | 44 // Returns the last time chrome was run in days. It uses a recorded value |
45 // set by SetLastRunTime(). Returns -1 if the value was not found or if | 45 // set by SetLastRunTime(). Returns -1 if the value was not found or if |
46 // the value is corrupted. | 46 // the value is corrupted. |
47 static int GetLastRunTime(); | 47 static int GetLastRunTime(); |
48 | 48 |
49 // Stores the time that this function was last called using an encoded | 49 // Stores the time that this function was last called using an encoded |
50 // form of the system local time. Retrieve the time using GetLastRunTime(). | 50 // form of the system local time. Retrieve the time using GetLastRunTime(). |
51 // Returns false if the value could not be stored. | 51 // Returns false if the value could not be stored. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 const std::wstring& value); | 143 const std::wstring& value); |
144 | 144 |
145 // True if a build is strictly organic, according to its brand code. | 145 // True if a build is strictly organic, according to its brand code. |
146 static bool IsOrganic(const std::wstring& brand); | 146 static bool IsOrganic(const std::wstring& brand); |
147 | 147 |
148 private: | 148 private: |
149 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 149 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
150 }; | 150 }; |
151 | 151 |
152 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 152 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
OLD | NEW |