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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java

Issue 2623373002: [Download Home] More correctly track paused state (Closed)
Patch Set: Move observer [de]registration Created 3 years, 11 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
Index: chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
index 717c2b872711c3f1556b8a557cb3d2427f0e1109..b411f1c8673bba069ce25e7f1ca0d28ac8d69e89 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
@@ -91,7 +91,7 @@ public class DownloadItemView extends SelectableItemView<DownloadHistoryItemWrap
mPauseResumeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- if (mItem.isResumable()) {
+ if (mItem.isPaused()) {
mItem.resume();
} else if (!mItem.isComplete()) {
mItem.pause();
@@ -133,14 +133,6 @@ public class DownloadItemView extends SelectableItemView<DownloadHistoryItemWrap
ThumbnailProvider thumbnailProvider = provider.getThumbnailProvider();
thumbnailProvider.cancelRetrieval(this);
- Context context = mFilesizeView.getContext();
- mFilenameCompletedView.setText(item.getDisplayFileName());
- mFilenameInProgressView.setText(item.getDisplayFileName());
- mHostnameView.setText(
- UrlFormatter.formatUrlForSecurityDisplay(item.getUrl(), false));
- mFilesizeView.setText(
- Formatter.formatFileSize(context, item.getFileSize()));
-
// Asynchronously grab a thumbnail for the file if it might have one.
int fileType = item.getFilterType();
mThumbnailBitmap = null;
@@ -173,13 +165,21 @@ public class DownloadItemView extends SelectableItemView<DownloadHistoryItemWrap
updateIconView();
+ Context context = mFilesizeView.getContext();
+ mFilenameCompletedView.setText(item.getDisplayFileName());
+ mFilenameInProgressView.setText(item.getDisplayFileName());
+ mHostnameView.setText(
+ UrlFormatter.formatUrlForSecurityDisplay(item.getUrl(), false));
+ mFilesizeView.setText(
+ Formatter.formatFileSize(context, item.getFileSize()));
+
if (item.isComplete()) {
showLayout(mLayoutCompleted);
} else {
showLayout(mLayoutInProgress);
mDownloadStatusView.setText(item.getStatusString());
- if (item.isResumable() || item.isPaused()) {
+ if (item.isPaused()) {
mPauseResumeButton.setImageResource(R.drawable.ic_media_control_play);
mPauseResumeButton.setContentDescription(
getContext().getString(R.string.download_notification_resume_button));

Powered by Google App Engine
This is Rietveld 408576698