summaryrefslogtreecommitdiffstats
path: root/chrome/installer/gcapi/gcapi.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 06:36:27 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 06:36:27 +0000
commitb0eebb403ad069142ec43e566134f4000f0f0f19 (patch)
treecc2f2a64fcf34264449031758c589055fd2072cf /chrome/installer/gcapi/gcapi.cc
parenta20548491e2b97baf01fa8d103eca5c1dd8d80db (diff)
downloadchromium_src-b0eebb403ad069142ec43e566134f4000f0f0f19.zip
chromium_src-b0eebb403ad069142ec43e566134f4000f0f0f19.tar.gz
chromium_src-b0eebb403ad069142ec43e566134f4000f0f0f19.tar.bz2
Revert 119841 - Implementation of GCAPI reactivation.
Also, some cleanup in gcapi_tests such that it now only runs gtest tests by default. BUG=111453 TEST=gcapi_tests.exe Review URL: https://chromiumcodereview.appspot.com/9288056 TBR=robertshield@chromium.org Review URL: https://chromiumcodereview.appspot.com/9302029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119865 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/gcapi/gcapi.cc')
-rw-r--r--chrome/installer/gcapi/gcapi.cc72
1 files changed, 0 insertions, 72 deletions
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 79d3a3c..bac5179 100644
--- a/chrome/installer/gcapi/gcapi.cc
+++ b/chrome/installer/gcapi/gcapi.cc
@@ -29,7 +29,6 @@
#include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h"
-#include "chrome/installer/gcapi/gcapi_reactivation.h"
#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/util_constants.h"
@@ -540,74 +539,3 @@ int __stdcall GoogleChromeDaysSinceLastRun() {
return days_since_last_run;
}
-
-BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code,
- int previous_brand_codes_length,
- const wchar_t** previous_brand_codes,
- DWORD* error_code) {
- DCHECK(error_code);
-
- if (!brand_code ||
- (previous_brand_codes_length > 0 && previous_brand_codes == NULL)) {
- if (error_code)
- *error_code = REACTIVATE_ERROR_INVALID_INPUT;
- return FALSE;
- }
-
- bool has_system_install = IsChromeInstalled(HKEY_LOCAL_MACHINE);
- bool has_user_install = IsChromeInstalled(HKEY_CURRENT_USER);
-
- if (!has_system_install && !has_user_install) {
- if (error_code)
- *error_code = REACTIVATE_ERROR_NOTINSTALLED;
- return FALSE;
- }
-
- int days_since_last_run = GoogleChromeDaysSinceLastRun();
- if (days_since_last_run > 0 &&
- days_since_last_run < kReactivationMinDaysDormant) {
- if (error_code)
- *error_code = REACTIVATE_ERROR_NOTDORMANT;
- return FALSE;
- }
-
- // Make sure we haven't previously been reactivated by this brand code
- // or any of the previous brand codes from this partner.
- 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;
-}
-
-BOOL __stdcall ReactivateChrome(wchar_t* brand_code,
- int previous_brand_codes_length,
- const wchar_t** previous_brand_codes,
- DWORD* error_code) {
- BOOL result = FALSE;
- if (CanOfferReactivation(brand_code,
- previous_brand_codes_length,
- previous_brand_codes,
- error_code)) {
- if (SetReactivationBrandCode(brand_code)) {
- // TODO(robertshield): Set Omaha reg key to add experiment label for
- // tracking 7DA.
- result = TRUE;
- } else {
- if (error_code)
- *error_code = REACTIVATE_ERROR_REACTIVATION_FAILED;
- }
- }
-
- return result;
-}
-