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

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)
21
22 // This function returns TRUE if Google Chrome should be offered. 20 // 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 21 // 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. 22 // for the reason, you can pass NULL for reasons.
25 // 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
26 // 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
27 // 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
28 // will set the flag only if Chrome can be offered. 26 // will set the flag only if Chrome can be offered.
29 DLLEXPORT BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, 27 BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag, DWORD* reasons);
30 DWORD *reasons);
31 28
32 // This function launches Google Chrome after a successful install. Make 29 // This function launches Google Chrome after a successful install. Make
33 // sure COM library is NOT initalized before you call this function (so if 30 // sure COM library is NOT initalized before you call this function (so if
34 // you called CoInitialize, call CoUninitialize before calling this function). 31 // you called CoInitialize, call CoUninitialize before calling this function).
35 DLLEXPORT BOOL __stdcall LaunchGoogleChrome(); 32 BOOL __stdcall LaunchGoogleChrome();
36 33
37 // This function launches Google Chrome after a successful install at the 34 // This function launches Google Chrome after a successful install at the
38 // given x,y coordinates with size height,length. Make 35 // given x,y coordinates with size height,length. Make
39 // sure COM library is NOT initalized before you call this function (so if 36 // sure COM library is NOT initalized before you call this function (so if
40 // you called CoInitialize, call CoUninitialize before calling this function). 37 // you called CoInitialize, call CoUninitialize before calling this function).
41 // This call is synchronous, meaning it waits for Chrome to launch and appear 38 // This call is synchronous, meaning it waits for Chrome to launch and appear
42 // to resize it before returning. 39 // to resize it before returning.
43 DLLEXPORT BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, 40 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x,
44 int y, 41 int y,
45 int width, 42 int width,
46 int height); 43 int height);
47 44
45 // 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
47 // present on the system, it will return the lowest last-run-days count of
48 // the two.
49 // 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
51 // launched.
52 int __stdcall GoogleChromeDaysSinceLastRun();
53
48 // Funtion pointer type declarations to use with GetProcAddress. 54 // Funtion pointer type declarations to use with GetProcAddress.
49 typedef BOOL (__stdcall * GCCC_CompatibilityCheck)(BOOL, DWORD *); 55 typedef BOOL (__stdcall *GCCC_CompatibilityCheck)(BOOL, DWORD *);
50 typedef BOOL (__stdcall * GCCC_LaunchGC)(HANDLE *); 56 typedef BOOL (__stdcall *GCCC_LaunchGC)(HANDLE *);
51 typedef BOOL (__stdcall * GCCC_LaunchGCWithDimensions)(int, int, int, int); 57 typedef BOOL (__stdcall *GCCC_LaunchGCWithDimensions)(int, int, int, int);
58 typedef int (__stdcall *GCCC_GoogleChromeDaysSinceLastRun)();
52 } // extern "C" 59 } // extern "C"
53 60
54 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_ 61 #endif // CHROME_INSTALLER_GCAPI_GCAPI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698