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

Unified Diff: chrome/installer/util/google_update_settings.cc

Issue 1606943007: Implement Windows GPO support for "dlpref" in component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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 e32e185d354c26607c7908f55f5c52ebb02a78c3..1708bb45d359c388b8d99ad364babacfb67205db 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -8,6 +8,7 @@
#include <algorithm>
#include <limits>
+#include <vector>
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -36,6 +37,10 @@ using installer::InstallationState;
const wchar_t GoogleUpdateSettings::kPoliciesKey[] =
L"SOFTWARE\\Policies\\Google\\Update";
const wchar_t GoogleUpdateSettings::kUpdatePolicyValue[] = L"UpdateDefault";
+const wchar_t GoogleUpdateSettings::kDownloadPreference[] =
+ L"DownloadPreference";
+const wchar_t GoogleUpdateSettings::kDownloadPreferenceCacheable[] =
+ L"cacheable";
const wchar_t GoogleUpdateSettings::kUpdateOverrideValuePrefix[] = L"Update";
const wchar_t GoogleUpdateSettings::kCheckPeriodOverrideMinutes[] =
L"AutoUpdateCheckPeriodMinutes";
@@ -770,6 +775,21 @@ bool GoogleUpdateSettings::ReenableAutoupdates() {
return true;
}
+// Reads and sanitizes the value of
+// "HKLM\SOFTWARE\Policies\Google\Update\DownloadPreference". The current
+// implementation supports only "cacheable" as a valid policy option.
waffles 2016/01/21 01:56:08 Do we want to consider an alternate sanitization p
Sorin Jianu 2016/01/21 02:53:55 I've sanitized by hand since adding a dependency o
+base::string16 GoogleUpdateSettings::GetDownloadPreference() {
+ RegKey policy_key;
+ base::string16 value;
+ if (policy_key.Open(HKEY_LOCAL_MACHINE, kPoliciesKey, KEY_QUERY_VALUE) ==
+ ERROR_SUCCESS &&
+ policy_key.ReadValue(kDownloadPreference, &value) == ERROR_SUCCESS &&
+ value == GoogleUpdateSettings::kDownloadPreferenceCacheable) {
+ return value;
+ }
+ return base::string16();
+}
+
void GoogleUpdateSettings::RecordChromeUpdatePolicyHistograms() {
const bool is_multi_install = InstallUtil::IsMultiInstall(
BrowserDistribution::GetDistribution(), IsSystemInstall());
« 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