Chromium Code Reviews| Index: chrome/installer/util/google_update_settings.cc |
| diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc |
| index a53b61e0c6e9b9ac312e929331ff8883c397acd6..6657c73e60dda6089953f01f96320cd0c14ffc7d 100644 |
| --- a/chrome/installer/util/google_update_settings.cc |
| +++ b/chrome/installer/util/google_update_settings.cc |
| @@ -668,3 +668,23 @@ bool GoogleUpdateSettings::SetExperimentLabels( |
| return success; |
| } |
| + |
| +bool GoogleUpdateSettings::ReadExperimentLabels( |
| + bool system_install, |
| + string16* experiment_labels) { |
| + HKEY reg_root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| + |
| + // If this distribution does not set the experiment labels, don't bother |
| + // reading. |
| + bool success = false; |
| + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| + if (dist->ShouldSetExperimentLabels()) { |
| + string16 client_state_path( |
| + system_install ? dist->GetStateMediumKey() : dist->GetStateKey()); |
| + RegKey client_state(reg_root, client_state_path.c_str(), KEY_READ); |
|
grt (UTC plus 2)
2013/01/09 18:49:51
KEY_READ -> KEY_QUERY_VALUE
SteveT
2013/01/09 19:36:10
Done. Care to explain the difference, though?
grt (UTC plus 2)
2013/01/10 02:58:51
I think it's good practice to request least privil
SteveT
2013/01/10 15:05:51
What's the difference between the two?
Feel free
grt (UTC plus 2)
2013/01/10 15:10:19
http://msdn.microsoft.com/library/windows/desktop/
|
| + success = client_state.ReadValue(google_update::kExperimentLabels, |
| + experiment_labels) == ERROR_SUCCESS; |
| + } |
| + |
| + return success; |
| +} |