| 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_frame/ready_mode/internal/registry_ready_mode_state.h" | 5 #include "chrome_frame/ready_mode/internal/registry_ready_mode_state.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 bool RegistryReadyModeState::GetStateFromRegistry(int64* value, bool* exists) { | 197 bool RegistryReadyModeState::GetStateFromRegistry(int64* value, bool* exists) { |
| 198 *exists = false; | 198 *exists = false; |
| 199 *value = 0; | 199 *value = 0; |
| 200 | 200 |
| 201 HKEY roots[] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }; | 201 HKEY roots[] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }; |
| 202 LONG result = ERROR_SUCCESS; | 202 LONG result = ERROR_SUCCESS; |
| 203 for (int i = 0; i < arraysize(roots); i++) { | 203 for (int i = 0; i < arraysize(roots); i++) { |
| 204 base::win::RegKey config_key; | 204 base::win::RegKey config_key; |
| 205 result = config_key.Open(roots[i], key_name_.c_str(), KEY_QUERY_VALUE); | 205 result = config_key.Open(roots[i], key_name_.c_str(), KEY_QUERY_VALUE); |
| 206 if (result == ERROR_SUCCESS) { | 206 if (result == ERROR_SUCCESS) { |
| 207 result = config_key.ReadInt64(installer::kChromeFrameReadyModeField, | 207 result = config_key.ReadValue(installer::kChromeFrameReadyModeField, |
| 208 value); | 208 value); |
| 209 if (result == ERROR_SUCCESS) { | 209 if (result == ERROR_SUCCESS) { |
| 210 *exists = true; | 210 *exists = true; |
| 211 return true; | 211 return true; |
| 212 } | 212 } |
| 213 if (result != ERROR_FILE_NOT_FOUND) { | 213 if (result != ERROR_FILE_NOT_FOUND) { |
| 214 DLOG(ERROR) << "Failed to read from registry key " << key_name_ | 214 DLOG(ERROR) << "Failed to read from registry key " << key_name_ |
| 215 << " and value " << installer::kChromeFrameReadyModeField | 215 << " and value " << installer::kChromeFrameReadyModeField |
| 216 << " error: " << result; | 216 << " error: " << result; |
| 217 return false; | 217 return false; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 246 | 246 |
| 247 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { | 247 void RegistryReadyModeState::PermanentlyDeclineChromeFrame() { |
| 248 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) | 248 if (LaunchAndCheckCommand(google_update::kRegCFOptOutCmdField)) |
| 249 RefreshStateAndNotify(); | 249 RefreshStateAndNotify(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void RegistryReadyModeState::AcceptChromeFrame() { | 252 void RegistryReadyModeState::AcceptChromeFrame() { |
| 253 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) | 253 if (LaunchAndCheckCommand(google_update::kRegCFOptInCmdField)) |
| 254 NotifyObserver(); | 254 NotifyObserver(); |
| 255 } | 255 } |
| OLD | NEW |