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

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

Issue 2203583002: Added unpacking step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added DMG to build file 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
« no previous file with comments | « chrome/installer/mac/app/Downloader.h ('k') | chrome/installer/mac/app/InstallerWindowController.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mac/app/Downloader.m
diff --git a/chrome/installer/mac/app/Downloader.m b/chrome/installer/mac/app/Downloader.m
index ff773dc86d38ec108154eebe5dee1b233ce10ea8..ce8482a41ecea3cd7fcc560ec8254e3e7d72c20e 100644
--- a/chrome/installer/mac/app/Downloader.m
+++ b/chrome/installer/mac/app/Downloader.m
@@ -10,17 +10,9 @@
@synthesize delegate = delegate_;
-+ (NSString*)getChromeDownloadFilePath {
- NSArray* downloadPaths = NSSearchPathForDirectoriesInDomains(
- NSDownloadsDirectory, NSUserDomainMask, YES);
- NSString* completeFilePath = [NSString
- pathWithComponents:@[ [downloadPaths firstObject], @"GoogleChrome.dmg" ]];
- return completeFilePath;
-}
-
// Downloads contents of chromeURL to downloads folders and delegates the work
// to the DownloadDelegate class.
-- (void)downloadChromeImageToDownloadsDirectory:(NSURL*)chromeImageURL {
+- (void)downloadChromeImageFrom:(NSURL*)chromeImageURL {
NSURLSession* session =
[NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration
defaultSessionConfiguration]
@@ -38,7 +30,7 @@
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
double downloadProgressPercentage =
(double)totalBytesWritten / totalBytesExpectedToWrite * 100.0;
- [delegate_ didDownloadData:downloadProgressPercentage];
+ [delegate_ downloader:self percentProgress:downloadProgressPercentage];
}
// Delegate method to move downloaded disk image to user's Download directory.
@@ -46,24 +38,14 @@
downloadTask:(NSURLSessionDownloadTask*)downloadTask
didFinishDownloadingToURL:(NSURL*)location {
assert([location isFileURL]);
- NSFileManager* manager = [NSFileManager defaultManager];
- NSURL* downloadsDirectory =
- [NSURL fileURLWithPath:[Downloader getChromeDownloadFilePath]];
- NSError* fileManagerError = nil;
- [manager moveItemAtURL:location
- toURL:downloadsDirectory
- error:&fileManagerError];
- if (fileManagerError) {
- [delegate_ downloader:self onDownloadFailureWithError:fileManagerError];
- }
- [delegate_ downloader:self onDownloadSuccess:location];
+ [delegate_ downloader:self onSuccess:location];
}
- (void)URLSession:(NSURLSession*)session
task:(NSURLSessionTask*)task
didCompleteWithError:(NSError*)error {
if (error) {
- [delegate_ downloader:self onDownloadFailureWithError:error];
+ [delegate_ downloader:self onFailure:error];
}
}
« no previous file with comments | « chrome/installer/mac/app/Downloader.h ('k') | chrome/installer/mac/app/InstallerWindowController.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698