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

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

Issue 7600023: Proper EULA handling for quick-enable. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 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) 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 #include "chrome/installer/util/google_update_settings.h" 5 #include "chrome/installer/util/google_update_settings.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 return ReadGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id); 264 return ReadGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id);
265 } 265 }
266 266
267 bool GoogleUpdateSettings::SetMetricsId(const std::wstring& metrics_id) { 267 bool GoogleUpdateSettings::SetMetricsId(const std::wstring& metrics_id) {
268 return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id); 268 return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id);
269 } 269 }
270 270
271 // EULA consent is only relevant for system-level installs. 271 // EULA consent is only relevant for system-level installs.
272 bool GoogleUpdateSettings::SetEULAConsent( 272 bool GoogleUpdateSettings::SetEULAConsent(
273 const InstallationState& machine_state, 273 const InstallationState& machine_state,
274 BrowserDistribution* dist,
274 bool consented) { 275 bool consented) {
276 DCHECK(dist);
275 const DWORD eula_accepted = consented ? 1 : 0; 277 const DWORD eula_accepted = consented ? 1 : 0;
276 // This magical method will return the right instance based on such details as
277 // whether or not --chrome-frame is present on the command-line.
278 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
279 std::wstring reg_path = dist->GetStateMediumKey(); 278 std::wstring reg_path = dist->GetStateMediumKey();
280 bool succeeded = true; 279 bool succeeded = true;
281 RegKey key; 280 RegKey key;
282 281
283 // Write the consent value into the product's ClientStateMedium key. 282 // Write the consent value into the product's ClientStateMedium key.
284 if (key.Create(HKEY_LOCAL_MACHINE, reg_path.c_str(), 283 if (key.Create(HKEY_LOCAL_MACHINE, reg_path.c_str(),
285 KEY_SET_VALUE) != ERROR_SUCCESS || 284 KEY_SET_VALUE) != ERROR_SUCCESS ||
286 key.WriteValue(google_update::kRegEULAAceptedField, 285 key.WriteValue(google_update::kRegEULAAceptedField,
287 eula_accepted) != ERROR_SUCCESS) { 286 eula_accepted) != ERROR_SUCCESS) {
288 succeeded = false; 287 succeeded = false;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 GetUpdatePolicyFromDword(value, &update_policy); 548 GetUpdatePolicyFromDword(value, &update_policy);
550 } 549 }
551 } 550 }
552 #endif // defined(GOOGLE_CHROME_BUILD) 551 #endif // defined(GOOGLE_CHROME_BUILD)
553 552
554 if (is_overridden != NULL) 553 if (is_overridden != NULL)
555 *is_overridden = found_override; 554 *is_overridden = found_override;
556 555
557 return update_policy; 556 return update_policy;
558 } 557 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_update_settings.h ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698