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

Unified Diff: chrome/installer/mac/app/MainDelegate.m

Issue 2203583002: Added unpacking step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed some of Sidney's comments for the moment Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698