Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10373)

Unified Diff: chrome/installer/gcapi/gcapi.cc

Issue 9704022: This patch modifies some aspects of GCAPI in support of the new Chrome reactivation functions. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698