Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Side by Side Diff: chrome/installer/gcapi/gcapi.h

Issue 8508060: Add functionality to the GCAPI to detect when Chrome was last run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 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 #define DLLEXPORT __declspec(dllexport) 20 #define DLLEXPORT __declspec(dllexport)
21 21
22 // This function returns TRUE if Google Chrome should be offered. 22 // This function returns TRUE if Google Chrome should be offered.
23 // If the return is FALSE, the reasons DWORD explains why. If you don't care 23 // If the return is FALSE, the reasons DWORD explains why. If you don't care
24 // for the reason, you can pass NULL for reasons. 24 // for the reason, you can pass NULL for reasons.
25 // set_flag indicates whether a flag should be set indicating that Chrome was 25 // set_flag indicates whether a flag should be set indicating that Chrome was
26 // offered within the last six months; if passed FALSE, this method will not 26 // offered within the last six months; if passed FALSE, this method will not
27 // set the flag even if Chrome can be offered. If passed TRUE, this method 27 // set the flag even if Chrome can be offered. If passed TRUE, this method
28 // will set the flag only if Chrome can be offered. 28 // will set the flag only if Chrome can be offered.
29 DLLEXPORT BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, 29 DLLEXPORT BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag,
30 DWORD *reasons); 30 DWORD* reasons);
31 31
32 // This function launches Google Chrome after a successful install. Make 32 // This function launches Google Chrome after a successful install. Make
33 // sure COM library is NOT initalized before you call this function (so if 33 // sure COM library is NOT initalized before you call this function (so if
34 // you called CoInitialize, call CoUninitialize before calling this function). 34 // you called CoInitialize, call CoUninitialize before calling this function).
35 DLLEXPORT BOOL __stdcall LaunchGoogleChrome(); 35 DLLEXPORT BOOL __stdcall LaunchGoogleChrome();
36 36
37 // This function launches Google Chrome after a successful install at the 37 // This function launches Google Chrome after a successful install at the
38 // given x,y coordinates with size height,length. Make 38 // given x,y coordinates with size height,length. Make
39 // sure COM library is NOT initalized before you call this function (so if 39 // sure COM library is NOT initalized before you call this function (so if
40 // you called CoInitialize, call CoUninitialize before calling this function). 40 // you called CoInitialize, call CoUninitialize before calling this function).
41 // This call is synchronous, meaning it waits for Chrome to launch and appear 41 // This call is synchronous, meaning it waits for Chrome to launch and appear
42 // to resize it before returning. 42 // to resize it before returning.
43 DLLEXPORT BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, 43 DLLEXPORT BOOL __stdcall LaunchGoogleChromeWithDimensions(int x,
44 int y, 44 int y,
45 int width, 45 int width,
46 int height); 46 int height);
47 47
48 // This function returns the number of days since Google Chrome was last run by
49 // the current user. If both user-level and machine-wide installations are
50 // present on the system, it will return the lowest last-run-days count of
51 // the two.
52 // Returns -1 if Chrome is not installed or we are otherwise unable to determine
53 // how long since Chrome was last launched.
54 DLLEXPORT int __stdcall GoogleChromeDaysSinceLastRun();
55
48 // Funtion pointer type declarations to use with GetProcAddress. 56 // Funtion pointer type declarations to use with GetProcAddress.
49 typedef BOOL (__stdcall * GCCC_CompatibilityCheck)(BOOL, DWORD *); 57 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *);
50 typedef BOOL (__stdcall * GCCC_LaunchGC)(HANDLE *); 58 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *);
51 typedef BOOL (__stdcall * GCCC_LaunchGCWithDimensions)(int, int, int, int); 59 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int);
60 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)();
52 } // extern "C" 61 } // extern "C"
53 62
54 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ 63 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698