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

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

Issue 2094583004: Initial commit for Chrome metainstaller on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed all comments except main block comment from elly Created 4 years, 5 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/main.m
diff --git a/chrome/installer/mac/app/main.m b/chrome/installer/mac/app/main.m
new file mode 100644
index 0000000000000000000000000000000000000000..1d1171564515ecc5c5240c5420eb5249e75842cc
--- /dev/null
+++ b/chrome/installer/mac/app/main.m
@@ -0,0 +1,32 @@
+// 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>
Mark Mentovai 2016/07/11 17:56:16 Blank line after this one.
+#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;
+}

Powered by Google App Engine
This is Rietveld 408576698