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

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

Issue 1150193004: Straighten up life cycle of native InfoBar pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed unrelated file Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/infobar/AccountChooserInfoBar.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/infobar/AccountChooserInfoBar.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698