OLD | NEW |
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 std::wstring value; | 95 std::wstring value; |
96 if (key.ReadValue(name, &value) != ERROR_SUCCESS) | 96 if (key.ReadValue(name, &value) != ERROR_SUCCESS) |
97 return false; | 97 return false; |
98 return (key.WriteValue(name, L"") == ERROR_SUCCESS); | 98 return (key.WriteValue(name, L"") == ERROR_SUCCESS); |
99 } | 99 } |
100 | 100 |
101 bool RemoveGoogleUpdateStrKey(const wchar_t* const name) { | 101 bool RemoveGoogleUpdateStrKey(const wchar_t* const name) { |
102 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 102 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
103 std::wstring reg_path = dist->GetStateKey(); | 103 std::wstring reg_path = dist->GetStateKey(); |
104 RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE); | 104 RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE); |
105 if (!key.ValueExists(name)) | 105 if (!key.HasValue(name)) |
106 return true; | 106 return true; |
107 return (key.DeleteValue(name) == ERROR_SUCCESS); | 107 return (key.DeleteValue(name) == ERROR_SUCCESS); |
108 } | 108 } |
109 | 109 |
110 EulaSearchResult HasEULASetting(HKEY root, const std::wstring& state_key, | 110 EulaSearchResult HasEULASetting(HKEY root, const std::wstring& state_key, |
111 bool setting) { | 111 bool setting) { |
112 RegKey key; | 112 RegKey key; |
113 DWORD previous_value = setting ? 1 : 0; | 113 DWORD previous_value = setting ? 1 : 0; |
114 if (key.Open(root, state_key.c_str(), KEY_QUERY_VALUE) != ERROR_SUCCESS) | 114 if (key.Open(root, state_key.c_str(), KEY_QUERY_VALUE) != ERROR_SUCCESS) |
115 return NO_SETTING; | 115 return NO_SETTING; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 GetUpdatePolicyFromDword(value, &update_policy); | 519 GetUpdatePolicyFromDword(value, &update_policy); |
520 } | 520 } |
521 } | 521 } |
522 #endif // defined(GOOGLE_CHROME_BUILD) | 522 #endif // defined(GOOGLE_CHROME_BUILD) |
523 | 523 |
524 if (is_overridden != NULL) | 524 if (is_overridden != NULL) |
525 *is_overridden = found_override; | 525 *is_overridden = found_override; |
526 | 526 |
527 return update_policy; | 527 return update_policy; |
528 } | 528 } |
OLD | NEW |