OLD | NEW |
1 // Copyright (c) 2011 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 // This function returns TRUE if Google Chrome should be offered. | 20 // This function returns TRUE if Google Chrome should be offered. |
21 // 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 |
22 // for the reason, you can pass NULL for reasons. | 22 // for the reason, you can pass NULL for reasons. |
23 // 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 |
24 // 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 |
25 // 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 |
26 // will set the flag only if Chrome can be offered. | 26 // will set the flag only if Chrome can be offered. |
27 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, DWORD* reasons); | 27 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, DWORD* reasons); |
28 | 28 |
29 // This function launches Google Chrome after a successful install. Make | 29 // This function launches Google Chrome after a successful install. Make |
30 // sure COM library is NOT initalized before you call this function (so if | 30 // sure COM library is NOT initialized before you call this function (so if |
31 // you called CoInitialize, call CoUninitialize before calling this function). | 31 // you called CoInitialize, call CoUninitialize before calling this function). |
32 BOOL __stdcall LaunchGoogleChrome(); | 32 BOOL __stdcall LaunchGoogleChrome(); |
33 | 33 |
34 // This function launches Google Chrome after a successful install at the | 34 // This function launches Google Chrome after a successful install at the |
35 // given x,y coordinates with size height,length. Make | 35 // given x,y coordinates with size height,length. Set in_background to true |
36 // sure COM library is NOT initalized before you call this function (so if | 36 // to move Google Chrome behind all other windows or false to have it appear |
37 // you called CoInitialize, call CoUninitialize before calling this function). | 37 // at the default z-order. Make sure that COM is NOT initialized before you call |
| 38 // this function (so if you called CoInitialize, call CoUninitialize before |
| 39 // calling this function). |
38 // This call is synchronous, meaning it waits for Chrome to launch and appear | 40 // This call is synchronous, meaning it waits for Chrome to launch and appear |
39 // to resize it before returning. | 41 // to resize it before returning. |
40 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, | 42 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, |
41 int y, | 43 int y, |
42 int width, | 44 int width, |
43 int height); | 45 int height, |
| 46 bool in_background); |
44 | 47 |
45 // 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 |
46 // 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 |
47 // 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 |
48 // the two. | 51 // the two. |
49 // 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, |
50 // 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 |
51 // launched. | 54 // launched. |
52 int __stdcall GoogleChromeDaysSinceLastRun(); | 55 int __stdcall GoogleChromeDaysSinceLastRun(); |
53 | 56 |
54 // Funtion pointer type declarations to use with GetProcAddress. | 57 // Funtion pointer type declarations to use with GetProcAddress. |
55 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *); | 58 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *); |
56 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *); | 59 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *); |
57 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int); | 60 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int); |
58 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)(); | 61 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)(); |
59 } // extern "C" | 62 } // extern "C" |
60 | 63 |
61 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ | 64 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ |
OLD | NEW |