OLD | NEW |
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.content.Context; | 7 import android.content.Context; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.net.Uri; | 9 import android.net.Uri; |
10 import android.os.AsyncTask; | 10 import android.os.AsyncTask; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (mPendingRequest != null) return; | 241 if (mPendingRequest != null) return; |
242 | 242 |
243 mPendingRequest = downloadInfo; | 243 mPendingRequest = downloadInfo; |
244 | 244 |
245 // TODO(dfalcantara): Ask ainslie@ for an icon to use for this InfoBar. | 245 // TODO(dfalcantara): Ask ainslie@ for an icon to use for this InfoBar. |
246 int drawableId = 0; | 246 int drawableId = 0; |
247 final String titleText = nativeGetDownloadWarningText(mPendingRequest.ge
tFileName()); | 247 final String titleText = nativeGetDownloadWarningText(mPendingRequest.ge
tFileName()); |
248 final String okButtonText = mContext.getResources().getString(R.string.o
k); | 248 final String okButtonText = mContext.getResources().getString(R.string.o
k); |
249 final String cancelButtonText = mContext.getResources().getString(R.stri
ng.cancel); | 249 final String cancelButtonText = mContext.getResources().getString(R.stri
ng.cancel); |
250 | 250 |
251 mTab.getInfoBarContainer().addInfoBar(new ConfirmInfoBar(0, | 251 mTab.getInfoBarContainer().addInfoBar(new ConfirmInfoBar( |
252 this, drawableId, null, titleText, null, okButtonText, cancelBut
tonText)); | 252 this, drawableId, null, titleText, null, okButtonText, cancelBut
tonText)); |
253 } | 253 } |
254 | 254 |
255 /** | 255 /** |
256 * Called when a danagers download is about to start. | 256 * Called when a danagers download is about to start. |
257 * | 257 * |
258 * @param filename File name of the download item. | 258 * @param filename File name of the download item. |
259 * @param downloadId ID of the download. | 259 * @param downloadId ID of the download. |
260 */ | 260 */ |
261 @Override | 261 @Override |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 } | 511 } |
512 | 512 |
513 private static native String nativeGetDownloadWarningText(String filename); | 513 private static native String nativeGetDownloadWarningText(String filename); |
514 private static native boolean nativeIsDownloadDangerous(String filename); | 514 private static native boolean nativeIsDownloadDangerous(String filename); |
515 private static native void nativeDangerousDownloadValidated( | 515 private static native void nativeDangerousDownloadValidated( |
516 Object tab, int downloadId, boolean accept); | 516 Object tab, int downloadId, boolean accept); |
517 private static native void nativeLaunchDownloadOverwriteInfoBar(ChromeDownlo
adDelegate delegate, | 517 private static native void nativeLaunchDownloadOverwriteInfoBar(ChromeDownlo
adDelegate delegate, |
518 Tab tab, DownloadInfo downloadInfo, String fileName, String dirName, | 518 Tab tab, DownloadInfo downloadInfo, String fileName, String dirName, |
519 String dirFullPath); | 519 String dirFullPath); |
520 } | 520 } |
OLD | NEW |