| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // CEEE module-wide utilities. | 5 // CEEE module-wide utilities. |
| 6 | 6 |
| 7 #include "ceee/ie/common/ceee_module_util.h" | 7 #include "ceee/ie/common/ceee_module_util.h" |
| 8 | 8 |
| 9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
| 10 | 10 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // TODO(vitalybuka@google.com) : remove this code and use | 296 // TODO(vitalybuka@google.com) : remove this code and use |
| 297 // GoogleUpdateSettings::GetCollectStatsConsent() code. | 297 // GoogleUpdateSettings::GetCollectStatsConsent() code. |
| 298 // BrowserDistribution requires modification to know about CEEE (bb3136374). | 298 // BrowserDistribution requires modification to know about CEEE (bb3136374). |
| 299 bool GetCollectStatsConsent() { | 299 bool GetCollectStatsConsent() { |
| 300 std::wstring reg_path = GetCromeFrameClientStateKey(); | 300 std::wstring reg_path = GetCromeFrameClientStateKey(); |
| 301 base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ); | 301 base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ); |
| 302 DWORD value = 0; | 302 DWORD value = 0; |
| 303 if (key.ReadValueDW(google_update::kRegUsageStatsField, &value) != | 303 if (key.ReadValueDW(google_update::kRegUsageStatsField, &value) != |
| 304 ERROR_SUCCESS) { | 304 ERROR_SUCCESS) { |
| 305 base::win::RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ); | 305 base::win::RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ); |
| 306 key.ReadValueDW(google_update::kRegUsageStatsField, &value); | 306 hklm_key.ReadValueDW(google_update::kRegUsageStatsField, &value); |
| 307 } | 307 } |
| 308 | 308 |
| 309 return (1 == value); | 309 return (1 == value); |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool RefreshElevationPolicyIfNeeded() { | 312 bool RefreshElevationPolicyIfNeeded() { |
| 313 if (ie_util::GetIeVersion() < ie_util::IEVERSION_IE7) | 313 if (ie_util::GetIeVersion() < ie_util::IEVERSION_IE7) |
| 314 return false; | 314 return false; |
| 315 | 315 |
| 316 // This may access InternetRegistry instead of real one. However this is | 316 // This may access InternetRegistry instead of real one. However this is |
| (...skipping 18 matching lines...) Expand all Loading... |
| 335 // Write after refreshing because it's better to refresh twice, than to miss | 335 // Write after refreshing because it's better to refresh twice, than to miss |
| 336 // once. | 336 // once. |
| 337 result = hkcu.WriteValue(kValueName, expected_version.c_str()); | 337 result = hkcu.WriteValue(kValueName, expected_version.c_str()); |
| 338 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed to write a registry value: " | 338 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed to write a registry value: " |
| 339 << kValueName << " error: " << com::LogWe(result); | 339 << kValueName << " error: " << com::LogWe(result); |
| 340 | 340 |
| 341 return true; | 341 return true; |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace ceee_module_util | 344 } // namespace ceee_module_util |
| OLD | NEW |