Chromium Code Reviews| Index: chrome/installer/mac/app/MainDelegate.m |
| diff --git a/chrome/installer/mac/app/MainDelegate.m b/chrome/installer/mac/app/MainDelegate.m |
| index 9662b5b8a69f769a4fc348c8d017b161573457d0..afe24276e2d5c01b033339fd0024a3accb33c28f 100644 |
| --- a/chrome/installer/mac/app/MainDelegate.m |
| +++ b/chrome/installer/mac/app/MainDelegate.m |
| @@ -4,6 +4,10 @@ |
| #import "MainDelegate.h" |
| +#import <AppKit/AppKit.h> |
| + |
| +extern dispatch_semaphore_t mount_semaphore; |
|
Sidney San Martín
2016/08/08 18:43:17
As discussed: a random extern definitely shouldn't
Anna Zeng
2016/08/12 22:56:18
Done.
|
| + |
| @implementation MainDelegate |
| - (void)runApplication { |
| @@ -26,11 +30,21 @@ |
| } |
| - (void)onDownloadSuccess { |
| - // TODO: replace the line of code below with real code someday to unpack dmg |
| - exit(0); |
| + Unpacker* unpack = [[Unpacker alloc] init]; |
| + unpack.delegate = self; |
| + mount_semaphore = dispatch_semaphore_create(0); |
| + |
| + [unpack mountDMG]; |
| + dispatch_semaphore_wait(mount_semaphore, DISPATCH_TIME_FOREVER); |
| + [unpack unmountDMG]; |
| + dispatch_semaphore_wait(mount_semaphore, DISPATCH_TIME_FOREVER); |
|
Sidney San Martín
2016/08/08 18:43:17
As discussed:
1. mountDMG and unmountDMG are imple
Anna Zeng
2016/08/12 22:56:18
#2 is taken care of; #1 is acknowledged and still
|
| } |
| - (void)onUnpackSuccess { |
| + if (![[NSWorkspace sharedWorkspace] launchApplication:@"Google Chromo"]) { |
| + NSLog(@"Chromo failed to launch"); |
| + } |
| + exit(0); |
| } |
| @end |