Index: chrome/installer/mac/app/main.m |
diff --git a/chrome/installer/mac/app/main.m b/chrome/installer/mac/app/main.m |
new file mode 100644 |
index 0000000000000000000000000000000000000000..502680bca248e19e600b8ec5c724aa7c12e286f5 |
--- /dev/null |
+++ b/chrome/installer/mac/app/main.m |
@@ -0,0 +1,31 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import <Foundation/Foundation.h> |
+#import "downloader.h" |
+#import "systemInfo.h" |
+#import "OmahaXMLRequest.h" |
+#import "OmahaCommunication.h" |
+ |
+void talkToOmahaThenExecuteBlock(OmahaRequestCompletionHandler block) { |
+ NSXMLDocument* requestBody = [OmahaXMLRequest createXMLRequestBody]; |
+ OmahaCommunication* messenger = [[OmahaCommunication alloc] |
+ initWithBody:requestBody]; |
+ [messenger sendRequestWithBlock:block]; |
+} |
+ |
+int main(){ |
+ talkToOmahaThenExecuteBlock(^(NSData* data, NSError* error) { |
+ if(error) { |
+ NSLog(@"%@", [error localizedDescription]); |
+ return; |
+ } |
+ Downloader* download = [[Downloader alloc] init]; |
+ [download downloadChromeImageToDownloadsDirectory: data]; |
+ }); |
+ |
+ // [[NSRunLoop mainRunLoop] run]; |
+ [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]]; |
+ return 1; |
+} |