Commit 0c6ba211 authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Download location: Always try to open file.

Currently we check externally removed flag to block opening file.

This logic is not mostly used.

1. On primary storage, we delete the db
record when the file is externally removed.

2. On SD card storage, this logic will block user to open the file when
reinserting the SD card.

So we should delete this logic and always try to open the file


Bug: 850307
Change-Id: Ibbd2c3e7c8bf0b2f69263a406cfa5b4240bf0097
Reviewed-on: https://chromium-review.googlesource.com/1096660Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566673}
parent 5e6f160b
......@@ -5,14 +5,11 @@
package org.chromium.chrome.browser.download.ui;
import android.content.ComponentName;
import android.content.Context;
import android.text.TextUtils;
import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.download.DownloadInfo;
import org.chromium.chrome.browser.download.DownloadItem;
import org.chromium.chrome.browser.download.DownloadMetrics;
......@@ -28,7 +25,6 @@ import org.chromium.components.offline_items_collection.OfflineItem.Progress;
import org.chromium.components.offline_items_collection.OfflineItemFilter;
import org.chromium.components.offline_items_collection.OfflineItemState;
import org.chromium.components.url_formatter.UrlFormatter;
import org.chromium.ui.widget.Toast;
import java.io.File;
import java.util.Collections;
......@@ -362,13 +358,6 @@ public abstract class DownloadHistoryItemWrapper extends TimedItem {
@Override
public void open() {
Context context = ContextUtils.getApplicationContext();
if (mItem.hasBeenExternallyRemoved()) {
Toast.makeText(context, context.getString(R.string.download_cant_open_file),
Toast.LENGTH_SHORT).show();
return;
}
if (DownloadUtils.openFile(getFile(), getMimeType(),
mItem.getDownloadInfo().getDownloadGuid(), isOffTheRecord(),
mItem.getDownloadInfo().getOriginalUrl(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment