summaryrefslogtreecommitdiffstats
path: root/chrome/installer/gcapi_mac
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-18 19:23:11 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-18 19:23:11 +0000
commit759bd439bb11c8a5f4f2970c1be2df0025523c86 (patch)
tree160605e17558619099e537f2992133fb5af43f2d /chrome/installer/gcapi_mac
parentd8f09f33eb464ae0d76b4e560ba82c4e6d439215 (diff)
downloadchromium_src-759bd439bb11c8a5f4f2970c1be2df0025523c86.zip
chromium_src-759bd439bb11c8a5f4f2970c1be2df0025523c86.tar.gz
chromium_src-759bd439bb11c8a5f4f2970c1be2df0025523c86.tar.bz2
mac gcapi: Add LaunchGoogleChrome() function.
BUG=128462 TEST=none Review URL: https://chromiumcodereview.appspot.com/10386218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/gcapi_mac')
-rw-r--r--chrome/installer/gcapi_mac/gcapi.h3
-rw-r--r--chrome/installer/gcapi_mac/gcapi.mm7
-rw-r--r--chrome/installer/gcapi_mac/gcapi_example_client.mm2
3 files changed, 12 insertions, 0 deletions
diff --git a/chrome/installer/gcapi_mac/gcapi.h b/chrome/installer/gcapi_mac/gcapi.h
index 3a84a1f..28a23aa 100644
--- a/chrome/installer/gcapi_mac/gcapi.h
+++ b/chrome/installer/gcapi_mac/gcapi.h
@@ -31,6 +31,9 @@ extern "C" {
// sense on mac, change comment.
int GoogleChromeCompatibilityCheck(unsigned* reasons);
+// This function launches Google Chrome after a successful install.
+int LaunchGoogleChrome();
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/chrome/installer/gcapi_mac/gcapi.mm b/chrome/installer/gcapi_mac/gcapi.mm
index 2530e8d..12413f5 100644
--- a/chrome/installer/gcapi_mac/gcapi.mm
+++ b/chrome/installer/gcapi_mac/gcapi.mm
@@ -122,3 +122,10 @@ int GoogleChromeCompatibilityCheck(unsigned* reasons) {
return local_reasons == 0;
}
+
+int LaunchGoogleChrome() {
+ @autoreleasepool {
+ return [[NSWorkspace sharedWorkspace]
+ launchApplication:@"/Applications/Google Chrome.app"];
+ }
+}
diff --git a/chrome/installer/gcapi_mac/gcapi_example_client.mm b/chrome/installer/gcapi_mac/gcapi_example_client.mm
index 902fff3..4b27496 100644
--- a/chrome/installer/gcapi_mac/gcapi_example_client.mm
+++ b/chrome/installer/gcapi_mac/gcapi_example_client.mm
@@ -10,4 +10,6 @@ int main() {
unsigned reasons;
int b = GoogleChromeCompatibilityCheck(&reasons);
NSLog(@"%d: %x", b, reasons);
+
+ LaunchGoogleChrome();
}