Chromium Code Reviews| Index: chrome/installer/gcapi/gcapi.cc |
| =================================================================== |
| --- chrome/installer/gcapi/gcapi.cc (revision 125017) |
| +++ chrome/installer/gcapi/gcapi.cc (working copy) |
| @@ -562,6 +562,14 @@ |
| DWORD* error_code) { |
| DCHECK(error_code); |
| + // If this function is invoked in elevated mode, always return TRUE. |
| + // We only really care what this function returns when it is invoked |
| + // in non-elevated mode. We return TRUE in elevated mode because we |
| + // want this function to return TRUE when ReactivateChrome is invoked |
| + // in elevated mode. |
| + if (shell_mode == GCAPI_INVOKED_UAC_ELEVATION) |
|
robertshield
2012/03/15 03:52:32
If a partner mistakenly invokes this method while
mgraboski
2012/03/22 00:33:25
Rather than always returning true, I've modified t
robertshield
2012/03/23 17:52:16
Looks good!
|
| + return TRUE; |
| + |
| if (!brand_code || |
| (previous_brand_codes_length > 0 && previous_brand_codes == NULL)) { |
| if (error_code) |
| @@ -586,26 +594,18 @@ |
| return FALSE; |
| } |
| - // Make sure we haven't previously been reactivated by this brand code |
| - // or any of the previous brand codes from this partner. |
| - // Since this function is invoked by ReactivateChrome, and since |
| - // ReactivateChrome is called first in non-elevated shell and |
| - // second in UAC-elevated shell, we only want to execute this block |
| - // of code the first time, in non-elevated mode. |
| - if (shell_mode == GCAPI_INVOKED_STANDARD_SHELL) { |
| - std::vector<std::wstring> reactivation_brands; |
| - reactivation_brands.push_back(brand_code); |
| - if (previous_brand_codes_length > 0 && previous_brand_codes != NULL) { |
| - std::copy(previous_brand_codes, |
| - previous_brand_codes + previous_brand_codes_length, |
| - std::back_inserter(reactivation_brands)); |
| - } |
| - if (HasBeenReactivatedByBrandCodes(reactivation_brands)) { |
| - if (error_code) |
| - *error_code = REACTIVATE_ERROR_ALREADY_REACTIVATED; |
| - return FALSE; |
| - } |
| + std::vector<std::wstring> reactivation_brands; |
| + reactivation_brands.push_back(brand_code); |
| + if (previous_brand_codes_length > 0 && previous_brand_codes != NULL) { |
| + std::copy(previous_brand_codes, |
| + previous_brand_codes + previous_brand_codes_length, |
| + std::back_inserter(reactivation_brands)); |
| } |
| + if (HasBeenReactivatedByBrandCodes(reactivation_brands)) { |
| + if (error_code) |
| + *error_code = REACTIVATE_ERROR_ALREADY_REACTIVATED; |
| + return FALSE; |
| + } |
| return TRUE; |
| } |