summaryrefslogtreecommitdiffstats
path: root/chrome/installer/gcapi/gcapi.h
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 03:59:20 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 03:59:20 +0000
commitebcb5207a92da2acf2034d4e2d9054b76b41c6d5 (patch)
tree6d6f2244e08bf66427f9734cf35e9a29dfa6f3d8 /chrome/installer/gcapi/gcapi.h
parent716a6125dd1633606261ba49b30408a466a6fc44 (diff)
downloadchromium_src-ebcb5207a92da2acf2034d4e2d9054b76b41c6d5.zip
chromium_src-ebcb5207a92da2acf2034d4e2d9054b76b41c6d5.tar.gz
chromium_src-ebcb5207a92da2acf2034d4e2d9054b76b41c6d5.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/gcapi/gcapi.h')
-rw-r--r--chrome/installer/gcapi/gcapi.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/chrome/installer/gcapi/gcapi.h b/chrome/installer/gcapi/gcapi.h
index a9fd040..30a5226 100644
--- a/chrome/installer/gcapi/gcapi.h
+++ b/chrome/installer/gcapi/gcapi.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,6 +17,17 @@ extern "C" {
#define GCCC_ERROR_ALREADYOFFERED 0x10
#define GCCC_ERROR_INTEGRITYLEVEL 0x20
+// Error conditions for CanReactivateChrome().
+#define REACTIVATE_ERROR_NOTINSTALLED 0x01
+#define REACTIVATE_ERROR_NOTDORMANT 0x02
+#define REACTIVATE_ERROR_ALREADY_REACTIVATED 0x04
+#define REACTIVATE_ERROR_INVALID_INPUT 0x08
+#define REACTIVATE_ERROR_REACTIVATION_FAILED 0x10
+
+// The minimum number of days an installation can be dormant before reactivation
+// may be offered.
+const int kReactivationMinDaysDormant = 50;
+
// This function returns TRUE if Google Chrome should be offered.
// If the return is FALSE, the reasons DWORD explains why. If you don't care
// for the reason, you can pass NULL for reasons.
@@ -54,11 +65,41 @@ BOOL __stdcall LaunchGoogleChromeWithDimensions(int x,
// launched.
int __stdcall GoogleChromeDaysSinceLastRun();
-// Funtion pointer type declarations to use with GetProcAddress.
+// Returns true if a vendor with the specified |brand_code| may offer
+// reactivation at this time. If the vendor has previously used other brand
+// codes, they must pass them in an array of size |previous_brand_codes_length|
+// as |previous_brand_codes|. Returns false if the vendor may not offer
+// reactivation at this time, and places one of the REACTIVATE_ERROR_XXX values
+// in |error_code| if |error_code| is non-null.
+BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code,
+ int previous_brand_codes_length,
+ const wchar_t** previous_brand_codes,
+ DWORD* error_code);
+
+// Attempts to reactivate Chrome for the specified |brand_code|. If the vendor
+// has previously used other brand codes, they must pass them in an array of
+// size |previous_brand_codes_length| as |previous_brand_codes|. Returns false
+// if reactivation fails, and places one of the REACTIVATE_ERROR_XXX values
+// in |error_code| if |error_code| is non-null.
+BOOL __stdcall ReactivateChrome(wchar_t* brand_code,
+ int previous_brand_codes_length,
+ const wchar_t** previous_brand_codes,
+ DWORD* error_code);
+
+// Function pointer type declarations to use with GetProcAddress.
typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *);
typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *);
typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int);
typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)();
+typedef BOOL (__stdcall *GCCC_CanOfferReactivation)(const wchar_t*,
+ int,
+ const wchar_t**,
+ DWORD*);
+typedef BOOL (__stdcall *GCCC_ReactivateChrome)(const wchar_t*,
+ int,
+ const wchar_t**,
+ DWORD*);
+
} // extern "C"
#endif // CHROME_INSTALLER_GCAPI_GCAPI_H_