diff options
Diffstat (limited to 'chrome/installer/util/google_update_settings.cc')
-rw-r--r-- | chrome/installer/util/google_update_settings.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index cbd887d..5d43ea48 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -21,6 +21,14 @@ bool ReadGoogleUpdateStrKey(const wchar_t* const name, std::wstring* value) { return true; } +bool WriteGoogleUpdateStrKey(const wchar_t* const name, + const std::wstring& value) { + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + std::wstring reg_path = dist->GetStateKey(); + RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE); + return key.WriteValue(name, value.c_str()); +} + bool ClearGoogleUpdateStrKey(const wchar_t* const name) { BrowserDistribution* dist = BrowserDistribution::GetDistribution(); std::wstring reg_path = dist->GetStateKey(); @@ -78,6 +86,14 @@ bool GoogleUpdateSettings::GetBrand(std::wstring* brand) { return ReadGoogleUpdateStrKey(google_update::kRegRLZBrandField, brand); } +bool GoogleUpdateSettings::GetClient(std::wstring* client) { + return ReadGoogleUpdateStrKey(google_update::kRegClientField, client); +} + +bool GoogleUpdateSettings::SetClient(const std::wstring& client) { + return WriteGoogleUpdateStrKey(google_update::kRegClientField, client); +} + bool GoogleUpdateSettings::GetReferral(std::wstring* referral) { return ReadGoogleUpdateStrKey(google_update::kRegReferralField, referral); } |