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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/download/OMADownloadHandler.java

Issue 2772343003: Android: Remove GetApplicationContext part 1 (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.download; 5 package org.chromium.chrome.browser.download;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.DownloadManager; 8 import android.app.DownloadManager;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.DialogInterface; 10 import android.content.DialogInterface;
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 .setUrl(url) 602 .setUrl(url)
603 .setMimeType(mimeType) 603 .setMimeType(mimeType)
604 .setDescription(omaInfo.getValue(OMA_DESCRIPTION)) 604 .setDescription(omaInfo.getValue(OMA_DESCRIPTION))
605 .setBytesReceived(getSize(omaInfo)) 605 .setBytesReceived(getSize(omaInfo))
606 .build(); 606 .build();
607 // If installNotifyURI is not empty, the downloaded content cannot 607 // If installNotifyURI is not empty, the downloaded content cannot
608 // be used until the PostStatusTask gets a 200-series response. 608 // be used until the PostStatusTask gets a 200-series response.
609 // Don't show complete notification until that happens. 609 // Don't show complete notification until that happens.
610 DownloadItem item = new DownloadItem(true, newInfo); 610 DownloadItem item = new DownloadItem(true, newInfo);
611 item.setSystemDownloadId(downloadId); 611 item.setSystemDownloadId(downloadId);
612 DownloadManagerService.getDownloadManagerService(mContext).enqueueDownlo adManagerRequest( 612 DownloadManagerService.getDownloadManagerService().enqueueDownloadManage rRequest(
613 item, omaInfo.isValueEmpty(OMA_INSTALL_NOTIFY_URI)); 613 item, omaInfo.isValueEmpty(OMA_INSTALL_NOTIFY_URI));
614 mPendingOMADownloads.put(downloadId, omaInfo); 614 mPendingOMADownloads.put(downloadId, omaInfo);
615 } 615 }
616 616
617 /** 617 /**
618 * Checks if an OMA download is currently pending. 618 * Checks if an OMA download is currently pending.
619 * 619 *
620 * @param downloadId Download identifier. 620 * @param downloadId Download identifier.
621 * @return true if the download is in progress, or false otherwise. 621 * @return true if the download is in progress, or false otherwise.
622 */ 622 */
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 } 732 }
733 } 733 }
734 showNextUrlDialog(mOMAInfo); 734 showNextUrlDialog(mOMAInfo);
735 } else if (mDownloadId != DownloadItem.INVALID_DOWNLOAD_ID) { 735 } else if (mDownloadId != DownloadItem.INVALID_DOWNLOAD_ID) {
736 // Remove the downloaded content. 736 // Remove the downloaded content.
737 manager.remove(mDownloadId); 737 manager.remove(mDownloadId);
738 } 738 }
739 } 739 }
740 } 740 }
741 } 741 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698