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" |
| 11 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 #include "base/version.h" | 14 #include "base/version.h" |
14 #include "chrome/installer/util/util_constants.h" | 15 #include "chrome/installer/util/util_constants.h" |
| 16 #include "components/metrics/client_info.h" |
15 | 17 |
16 class AppRegistrationData; | 18 class AppRegistrationData; |
17 class BrowserDistribution; | 19 class BrowserDistribution; |
18 | 20 |
19 namespace installer { | 21 namespace installer { |
20 class ChannelInfo; | 22 class ChannelInfo; |
21 class InstallationState; | 23 class InstallationState; |
22 } | 24 } |
23 | 25 |
24 // This class provides accessors to the Google Update 'ClientState' information | 26 // This class provides accessors to the Google Update 'ClientState' information |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // crash dumps to Google. This information is collected by the web server | 81 // crash dumps to Google. This information is collected by the web server |
80 // used to download the chrome installer. | 82 // used to download the chrome installer. |
81 static bool GetCollectStatsConsentAtLevel(bool system_install); | 83 static bool GetCollectStatsConsentAtLevel(bool system_install); |
82 | 84 |
83 // Sets the user consent to send UMA and crash dumps to Google. Returns | 85 // Sets the user consent to send UMA and crash dumps to Google. Returns |
84 // false if the setting could not be recorded. | 86 // false if the setting could not be recorded. |
85 static bool SetCollectStatsConsentAtLevel(bool system_install, | 87 static bool SetCollectStatsConsentAtLevel(bool system_install, |
86 bool consented); | 88 bool consented); |
87 #endif | 89 #endif |
88 | 90 |
89 // Returns the metrics client id backed up in the registry. If none found, | 91 // Returns the metrics client info backed up in the registry. NULL |
90 // returns empty string. | 92 // if-and-only-if the client_id couldn't be retrieved (failure to retrieve |
91 static bool LoadMetricsClientId(std::string* metrics_id); | 93 // other fields only makes them keep their default value). A non-null return |
| 94 // will NEVER contain an empty client_id field. |
| 95 static scoped_ptr<metrics::ClientInfo> LoadMetricsClientInfo(); |
92 | 96 |
93 // Stores a backup of the metrics client id in the registry. | 97 // Stores a backup of the metrics client info in the registry. Storing a |
94 static bool StoreMetricsClientId(const std::string& metrics_id); | 98 // |client_info| with an empty client id will effectively void the backup. |
| 99 static void StoreMetricsClientInfo(const metrics::ClientInfo& client_info); |
95 | 100 |
96 // Sets the machine-wide EULA consented flag required on OEM installs. | 101 // Sets the machine-wide EULA consented flag required on OEM installs. |
97 // Returns false if the setting could not be recorded. | 102 // Returns false if the setting could not be recorded. |
98 static bool SetEULAConsent(const installer::InstallationState& machine_state, | 103 static bool SetEULAConsent(const installer::InstallationState& machine_state, |
99 BrowserDistribution* dist, | 104 BrowserDistribution* dist, |
100 bool consented); | 105 bool consented); |
101 | 106 |
102 // Returns the last time chrome was run in days. It uses a recorded value | 107 // Returns the last time chrome was run in days. It uses a recorded value |
103 // set by SetLastRunTime(). Returns -1 if the value was not found or if | 108 // set by SetLastRunTime(). Returns -1 if the value was not found or if |
104 // the value is corrupted. | 109 // the value is corrupted. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // this will do nothing to |experiment_labels|. This will return true if the | 311 // this will do nothing to |experiment_labels|. This will return true if the |
307 // label did not exist, or was successfully read. | 312 // label did not exist, or was successfully read. |
308 static bool ReadExperimentLabels(bool system_install, | 313 static bool ReadExperimentLabels(bool system_install, |
309 base::string16* experiment_labels); | 314 base::string16* experiment_labels); |
310 | 315 |
311 private: | 316 private: |
312 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 317 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
313 }; | 318 }; |
314 | 319 |
315 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 320 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
OLD | NEW |