Index: chrome_frame/utils.cc |
=================================================================== |
--- chrome_frame/utils.cc (revision 71561) |
+++ chrome_frame/utils.cc (working copy) |
@@ -233,7 +233,8 @@ |
bool success = false; |
if (cf_state_key.Valid()) { |
if (set) { |
- success = cf_state_key.WriteValue(kChromeFramePersistNPAPIReg, 1); |
+ success = (cf_state_key.WriteValue(kChromeFramePersistNPAPIReg, 1) |
+ == ERROR_SUCCESS); |
grt (UTC plus 2)
2011/01/16 04:19:48
Wrapping and indentation
amit
2011/01/16 07:54:28
Done.
|
} else { |
// Unfortunately, DeleteValue returns true only if the value |
// previously existed, so we do a separate existence check to |
@@ -255,7 +256,8 @@ |
bool success = false; |
if (cf_state_key.Valid()) { |
DWORD val = 0; |
- if (cf_state_key.ReadValueDW(kChromeFramePersistNPAPIReg, &val)) { |
+ if (cf_state_key.ReadValueDW(kChromeFramePersistNPAPIReg, &val) |
+ == ERROR_SUCCESS) { |
grt (UTC plus 2)
2011/01/16 04:19:48
Wrapping
amit
2011/01/16 07:54:28
Done.
|
success = (val != 0); |
} |
} |
@@ -676,11 +678,8 @@ |
int ret = default_value; |
RegKey config_key; |
if (config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, |
- KEY_QUERY_VALUE)) { |
- int value = FALSE; |
- if (config_key.ReadValueDW(value_name, reinterpret_cast<DWORD*>(&value))) { |
- ret = value; |
- } |
+ KEY_QUERY_VALUE) == ERROR_SUCCESS) { |
+ config_key.ReadValueDW(value_name, reinterpret_cast<DWORD*>(&ret)); |
} |
return ret; |
@@ -694,8 +693,8 @@ |
bool SetConfigInt(const wchar_t* value_name, int value) { |
RegKey config_key; |
if (config_key.Create(HKEY_CURRENT_USER, kChromeFrameConfigKey, |
- KEY_SET_VALUE)) { |
- if (config_key.WriteValue(value_name, value)) { |
+ KEY_SET_VALUE) == ERROR_SUCCESS) { |
+ if (config_key.WriteValue(value_name, value) == ERROR_SUCCESS) { |
return true; |
} |
} |
@@ -710,8 +709,10 @@ |
bool DeleteConfigValue(const wchar_t* value_name) { |
RegKey config_key; |
if (config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, |
- KEY_WRITE)) { |
- return config_key.DeleteValue(value_name); |
+ KEY_WRITE) == ERROR_SUCCESS) { |
+ if (config_key.DeleteValue(value_name) == ERROR_SUCCESS) { |
+ return true; |
+ } |
} |
return false; |
} |
@@ -728,7 +729,8 @@ |
// TODO(tommi): Implement caching for this config value as it gets |
// checked frequently. |
RegKey config_key; |
- if (config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, KEY_READ)) { |
+ if (config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, |
+ KEY_READ) == ERROR_SUCCESS) { |
config_key.ReadValueDW(kEnableGCFRendererByDefault, &is_default); |
} |
} |
@@ -751,7 +753,8 @@ |
} |
RegKey config_key; |
- if (!config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, KEY_READ)) |
+ if (config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, |
+ KEY_READ) != ERROR_SUCCESS) |
return RENDERER_TYPE_UNDETERMINED; |
grt (UTC plus 2)
2011/01/16 04:19:48
Add braces around this line since the if spans mul
amit
2011/01/16 07:54:28
Done.
|
RendererType renderer_type = RENDERER_TYPE_UNDETERMINED; |