Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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(). | 20 // Error conditions for CanReactivateChrome(). |
| 21 #define REACTIVATE_ERROR_NOTINSTALLED 0x01 | 21 #define REACTIVATE_ERROR_NOTINSTALLED 0x01 |
| 22 #define REACTIVATE_ERROR_NOTDORMANT 0x02 | 22 #define REACTIVATE_ERROR_NOTDORMANT 0x02 |
| 23 #define REACTIVATE_ERROR_ALREADY_REACTIVATED 0x04 | 23 #define REACTIVATE_ERROR_ALREADY_REACTIVATED 0x04 |
| 24 #define REACTIVATE_ERROR_INVALID_INPUT 0x08 | 24 #define REACTIVATE_ERROR_INVALID_INPUT 0x08 |
| 25 #define REACTIVATE_ERROR_REACTIVATION_FAILED 0x10 | 25 #define REACTIVATE_ERROR_REACTIVATION_FAILED 0x10 |
| 26 | 26 |
| 27 // Flags to indicate whether GCAPI is invoked | |
|
Roger Tawa OOO till Jul 10th
2012/02/24 21:46:59
whether -> how ?
robertshield
2012/02/24 22:21:40
Done.
| |
| 28 #define GCAPI_INVOKED_STANDARD_SHELL 0x01 | |
| 29 #define GCAPI_INVOKED_UAC_ELEVATION 0x02 | |
| 30 | |
| 27 // The minimum number of days an installation can be dormant before reactivation | 31 // The minimum number of days an installation can be dormant before reactivation |
| 28 // may be offered. | 32 // may be offered. |
| 29 const int kReactivationMinDaysDormant = 50; | 33 const int kReactivationMinDaysDormant = 50; |
| 30 | 34 |
| 31 // This function returns TRUE if Google Chrome should be offered. | 35 // 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 | 36 // 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. | 37 // for the reason, you can pass NULL for reasons. |
| 34 // set_flag indicates whether a flag should be set indicating that Chrome was | 38 // 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 | 39 // 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 | 40 // 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. | 41 // will set the flag only if Chrome can be offered. |
|
Roger Tawa OOO till Jul 10th
2012/02/24 21:46:59
add a description for new arg. same below.
robertshield
2012/02/24 22:21:40
Done.
| |
| 38 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, DWORD* reasons); | 42 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, |
| 43 int shell_mode, | |
| 44 DWORD* reasons); | |
| 39 | 45 |
| 40 // This function launches Google Chrome after a successful install. Make | 46 // This function launches Google Chrome after a successful install. Make |
| 41 // sure COM library is NOT initialized before you call this function (so if | 47 // sure COM library is NOT initialized before you call this function (so if |
| 42 // you called CoInitialize, call CoUninitialize before calling this function). | 48 // you called CoInitialize, call CoUninitialize before calling this function). |
| 43 BOOL __stdcall LaunchGoogleChrome(); | 49 BOOL __stdcall LaunchGoogleChrome(); |
| 44 | 50 |
| 45 // This function launches Google Chrome after a successful install at the | 51 // This function launches Google Chrome after a successful install at the |
| 46 // given x,y coordinates with size height,length. Set in_background to true | 52 // given x,y coordinates with size height,length. Set in_background to true |
| 47 // to move Google Chrome behind all other windows or false to have it appear | 53 // to move Google Chrome behind all other windows or false to have it appear |
| 48 // at the default z-order. Make sure that COM is NOT initialized before you call | 54 // at the default z-order. Make sure that COM is NOT initialized before you call |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 67 | 73 |
| 68 // Returns true if a vendor with the specified |brand_code| may offer | 74 // Returns true if a vendor with the specified |brand_code| may offer |
| 69 // reactivation at this time. If the vendor has previously used other brand | 75 // 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| | 76 // 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 | 77 // 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 | 78 // reactivation at this time, and places one of the REACTIVATE_ERROR_XXX values |
| 73 // in |error_code| if |error_code| is non-null. | 79 // in |error_code| if |error_code| is non-null. |
| 74 BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code, | 80 BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code, |
| 75 int previous_brand_codes_length, | 81 int previous_brand_codes_length, |
| 76 const wchar_t** previous_brand_codes, | 82 const wchar_t** previous_brand_codes, |
| 83 int shell_mode, | |
| 77 DWORD* error_code); | 84 DWORD* error_code); |
| 78 | 85 |
| 79 // Attempts to reactivate Chrome for the specified |brand_code|. If the vendor | 86 // 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 | 87 // 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 | 88 // size |previous_brand_codes_length| as |previous_brand_codes|. Returns false |
| 82 // if reactivation fails, and places one of the REACTIVATE_ERROR_XXX values | 89 // if reactivation fails, and places one of the REACTIVATE_ERROR_XXX values |
| 83 // in |error_code| if |error_code| is non-null. | 90 // in |error_code| if |error_code| is non-null. |
| 84 BOOL __stdcall ReactivateChrome(wchar_t* brand_code, | 91 BOOL __stdcall ReactivateChrome(wchar_t* brand_code, |
| 85 int previous_brand_codes_length, | 92 int previous_brand_codes_length, |
| 86 const wchar_t** previous_brand_codes, | 93 const wchar_t** previous_brand_codes, |
| 94 int shell_mode, | |
| 87 DWORD* error_code); | 95 DWORD* error_code); |
| 88 | 96 |
| 89 // Function pointer type declarations to use with GetProcAddress. | 97 // Function pointer type declarations to use with GetProcAddress. |
| 90 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *); | 98 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, int, DWORD *); |
| 91 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *); | 99 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *); |
| 92 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int); | 100 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int); |
| 93 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)(); | 101 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)(); |
| 94 typedef BOOL (__stdcall *GCCC_CanOfferReactivation)(const wchar_t*, | 102 typedef BOOL (__stdcall *GCCC_CanOfferReactivation)(const wchar_t*, |
| 95 int, | 103 int, |
| 96 const wchar_t**, | 104 const wchar_t**, |
| 105 int, | |
| 97 DWORD*); | 106 DWORD*); |
| 98 typedef BOOL (__stdcall *GCCC_ReactivateChrome)(const wchar_t*, | 107 typedef BOOL (__stdcall *GCCC_ReactivateChrome)(const wchar_t*, |
| 99 int, | 108 int, |
| 100 const wchar_t**, | 109 const wchar_t**, |
| 110 int, | |
| 101 DWORD*); | 111 DWORD*); |
| 102 | 112 |
| 103 } // extern "C" | 113 } // extern "C" |
| 104 | 114 |
| 105 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ | 115 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ |
| OLD | NEW |