OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_INSTALLER_GCAPI_GCAPI_H_ | 5 #ifndef CHROME_INSTALLER_GCAPI_GCAPI_H_ |
6 #define CHROME_INSTALLER_GCAPI_GCAPI_H_ | 6 #define CHROME_INSTALLER_GCAPI_GCAPI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
11 extern "C" { | 11 extern "C" { |
12 // Error conditions for GoogleChromeCompatibilityCheck(). | 12 // Error conditions for GoogleChromeCompatibilityCheck(). |
13 #define GCCC_ERROR_USERLEVELALREADYPRESENT 0x01 | 13 #define GCCC_ERROR_USERLEVELALREADYPRESENT 0x01 |
14 #define GCCC_ERROR_SYSTEMLEVELALREADYPRESENT 0x02 | 14 #define GCCC_ERROR_SYSTEMLEVELALREADYPRESENT 0x02 |
15 #define GCCC_ERROR_ACCESSDENIED 0x04 | 15 #define GCCC_ERROR_ACCESSDENIED 0x04 |
16 #define GCCC_ERROR_OSNOTSUPPORTED 0x08 | 16 #define GCCC_ERROR_OSNOTSUPPORTED 0x08 |
17 #define GCCC_ERROR_ALREADYOFFERED 0x10 | 17 #define GCCC_ERROR_ALREADYOFFERED 0x10 |
18 #define GCCC_ERROR_INTEGRITYLEVEL 0x20 | 18 #define GCCC_ERROR_INTEGRITYLEVEL 0x20 |
19 | 19 |
20 // Error conditions for CanReactivateChrome(). | |
21 #define REACTIVATE_ERROR_NOTINSTALLED 0x01 | |
22 #define REACTIVATE_ERROR_NOTDORMANT 0x02 | |
23 #define REACTIVATE_ERROR_ALREADY_REACTIVATED 0x04 | |
24 #define REACTIVATE_ERROR_INVALID_INPUT 0x08 | |
25 #define REACTIVATE_ERROR_REACTIVATION_FAILED 0x10 | |
26 | |
27 // The minimum number of days an installation can be dormant before reactivation | |
28 // may be offered. | |
29 const int kReactivationMinDaysDormant = 50; | |
30 | |
31 // This function returns TRUE if Google Chrome should be offered. | 20 // This function returns TRUE if Google Chrome should be offered. |
32 // If the return is FALSE, the reasons DWORD explains why. If you don't care | 21 // If the return is FALSE, the reasons DWORD explains why. If you don't care |
33 // for the reason, you can pass NULL for reasons. | 22 // for the reason, you can pass NULL for reasons. |
34 // set_flag indicates whether a flag should be set indicating that Chrome was | 23 // set_flag indicates whether a flag should be set indicating that Chrome was |
35 // offered within the last six months; if passed FALSE, this method will not | 24 // offered within the last six months; if passed FALSE, this method will not |
36 // set the flag even if Chrome can be offered. If passed TRUE, this method | 25 // set the flag even if Chrome can be offered. If passed TRUE, this method |
37 // will set the flag only if Chrome can be offered. | 26 // will set the flag only if Chrome can be offered. |
38 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, DWORD* reasons); | 27 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, DWORD* reasons); |
39 | 28 |
40 // This function launches Google Chrome after a successful install. Make | 29 // This function launches Google Chrome after a successful install. Make |
(...skipping 17 matching lines...) Expand all Loading... |
58 | 47 |
59 // This function returns the number of days since Google Chrome was last run by | 48 // This function returns the number of days since Google Chrome was last run by |
60 // the current user. If both user-level and machine-wide installations are | 49 // the current user. If both user-level and machine-wide installations are |
61 // present on the system, it will return the lowest last-run-days count of | 50 // present on the system, it will return the lowest last-run-days count of |
62 // the two. | 51 // the two. |
63 // Returns -1 if Chrome is not installed, the last run date is in the future, | 52 // Returns -1 if Chrome is not installed, the last run date is in the future, |
64 // or we are otherwise unable to determine how long since Chrome was last | 53 // or we are otherwise unable to determine how long since Chrome was last |
65 // launched. | 54 // launched. |
66 int __stdcall GoogleChromeDaysSinceLastRun(); | 55 int __stdcall GoogleChromeDaysSinceLastRun(); |
67 | 56 |
68 // Returns true if a vendor with the specified |brand_code| may offer | 57 // Funtion pointer type declarations to use with GetProcAddress. |
69 // reactivation at this time. If the vendor has previously used other brand | |
70 // codes, they must pass them in an array of size |previous_brand_codes_length| | |
71 // as |previous_brand_codes|. Returns false if the vendor may not offer | |
72 // reactivation at this time, and places one of the REACTIVATE_ERROR_XXX values | |
73 // in |error_code| if |error_code| is non-null. | |
74 BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code, | |
75 int previous_brand_codes_length, | |
76 const wchar_t** previous_brand_codes, | |
77 DWORD* error_code); | |
78 | |
79 // Attempts to reactivate Chrome for the specified |brand_code|. If the vendor | |
80 // has previously used other brand codes, they must pass them in an array of | |
81 // size |previous_brand_codes_length| as |previous_brand_codes|. Returns false | |
82 // if reactivation fails, and places one of the REACTIVATE_ERROR_XXX values | |
83 // in |error_code| if |error_code| is non-null. | |
84 BOOL __stdcall ReactivateChrome(wchar_t* brand_code, | |
85 int previous_brand_codes_length, | |
86 const wchar_t** previous_brand_codes, | |
87 DWORD* error_code); | |
88 | |
89 // Function pointer type declarations to use with GetProcAddress. | |
90 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *); | 58 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *); |
91 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *); | 59 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *); |
92 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int); | 60 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int); |
93 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)(); | 61 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)(); |
94 typedef BOOL (__stdcall *GCCC_CanOfferReactivation)(const wchar_t*, | |
95 int, | |
96 const wchar_t**, | |
97 DWORD*); | |
98 typedef BOOL (__stdcall *GCCC_ReactivateChrome)(const wchar_t*, | |
99 int, | |
100 const wchar_t**, | |
101 DWORD*); | |
102 | |
103 } // extern "C" | 62 } // extern "C" |
104 | 63 |
105 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ | 64 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ |
OLD | NEW |