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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java

Issue 2507793002: [NTP] Propagate OfflineId from C++ for Downloads. (Closed)
Patch Set: rebase. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index fee813a2a49f2422b9113b0c8f2f8023dbe3c2ff..7a8158252ab8c24cea0daaa4fc29f69667e85858 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -354,7 +354,6 @@ public class NewTabPage
mSnippetsBridge.onSuggestionOpened(article, windowOpenDisposition);
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_SNIPPET);
- // TODO(vitaliii): Propagate OfflineId for offline page downloads from C++.
if (article.isDownload() && article.mIsDownloadedAsset) {
DownloadUtils.openFile(
article.getDownloadAssetFile(), article.getDownloadAssetMimeType(), false);
@@ -403,8 +402,10 @@ public class NewTabPage
int tabIndex = TabModelUtils.getTabIndexById(tabModel, tabId);
if (tabIndex == TabModel.INVALID_TAB_INDEX) return false;
TabModelUtils.setIndex(tabModel, tabIndex);
+ assert recentTabArticle.getOfflinePageOfflineId().equals(
+ Long.parseLong(recentTabArticle.getRecentTabId()));
OfflinePageUtils.openInExistingTab(recentTabArticle.mUrl,
- Long.parseLong(recentTabArticle.getRecentTabId()), tabModel.getTabAt(tabIndex));
+ recentTabArticle.getOfflinePageOfflineId(), tabModel.getTabAt(tabIndex));
return true;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698