Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/installer/util/google_update_settings.cc

Issue 2222903004: Clear client id prefs when opting out of UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/installer/util/google_update_settings.h" 5 #include "chrome/installer/util/google_update_settings.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 root_key, reg_path.c_str(), KEY_SET_VALUE | KEY_WOW64_32KEY); 322 root_key, reg_path.c_str(), KEY_SET_VALUE | KEY_WOW64_32KEY);
323 if (result != ERROR_SUCCESS) { 323 if (result != ERROR_SUCCESS) {
324 LOG(ERROR) << "Failed opening key " << reg_path << " to set " 324 LOG(ERROR) << "Failed opening key " << reg_path << " to set "
325 << google_update::kRegUsageStatsField << "; result: " << result; 325 << google_update::kRegUsageStatsField << "; result: " << result;
326 } else { 326 } else {
327 result = key.WriteValue(google_update::kRegUsageStatsField, value); 327 result = key.WriteValue(google_update::kRegUsageStatsField, value);
328 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed setting " 328 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed setting "
329 << google_update::kRegUsageStatsField << " in key " << reg_path 329 << google_update::kRegUsageStatsField << " in key " << reg_path
330 << "; result: " << result; 330 << "; result: " << result;
331 } 331 }
332
333 // When opting out, clear registry backup of client id and related values.
334 if (result == ERROR_SUCCESS && !consented)
335 StoreMetricsClientInfo(metrics::ClientInfo());
336
332 return (result == ERROR_SUCCESS); 337 return (result == ERROR_SUCCESS);
333 } 338 }
334 339
335 // static 340 // static
336 bool GoogleUpdateSettings::GetCollectStatsConsentDefault( 341 bool GoogleUpdateSettings::GetCollectStatsConsentDefault(
337 bool* stats_consent_default) { 342 bool* stats_consent_default) {
338 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 343 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
339 installer::ChannelInfo channel_info; 344 installer::ChannelInfo channel_info;
340 bool is_multi_install = false; 345 bool is_multi_install = false;
341 if (InitChannelInfo(IsSystemInstall(), dist, &channel_info, 346 if (InitChannelInfo(IsSystemInstall(), dist, &channel_info,
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } 1040 }
1036 1041
1037 // If the key or value was not present, return the empty string. 1042 // If the key or value was not present, return the empty string.
1038 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { 1043 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) {
1039 experiment_labels->clear(); 1044 experiment_labels->clear();
1040 return true; 1045 return true;
1041 } 1046 }
1042 1047
1043 return result == ERROR_SUCCESS; 1048 return result == ERROR_SUCCESS;
1044 } 1049 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_reporting_state.cc ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698