Search in sources :

Example 6 with DownloadNotifier

use of org.chromium.chrome.browser.download.DownloadNotifier in project AndroidChromium by JackyAndroid.

the class OfflinePageNotificationBridge method notifyDownloadSuccessful.

/**
    * Update download notification to success.
    * @param context Context to show notifications.
    * @param guid GUID of a request to download a page related to the notification.
    * @param url URL of the page to download.
    * @param displayName Name to be displayed on notification.
    */
@CalledByNative
public static void notifyDownloadSuccessful(Context context, String guid, String url, String displayName) {
    DownloadNotifier notifier = getDownloadNotifier(context);
    if (notifier == null)
        return;
    DownloadInfo downloadInfo = new DownloadInfo.Builder().setIsOfflinePage(true).setDownloadGuid(guid).setFileName(displayName).setIsResumable(false).setIsOffTheRecord(false).build();
    notifier.notifyDownloadSuccessful(downloadInfo, -1, false, true);
}
Also used : DownloadNotifier(org.chromium.chrome.browser.download.DownloadNotifier) DownloadInfo(org.chromium.chrome.browser.download.DownloadInfo) CalledByNative(org.chromium.base.annotations.CalledByNative)

Aggregations

CalledByNative (org.chromium.base.annotations.CalledByNative)6 DownloadNotifier (org.chromium.chrome.browser.download.DownloadNotifier)6 DownloadInfo (org.chromium.chrome.browser.download.DownloadInfo)5