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

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

Issue 2245583002: Split OfflinePageSuggestions into two categories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@offlinedismissed
Patch Set: More-buttons for the Recent Tabs and Downloads sections Created 4 years, 4 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/ntp/cards/SuggestionsSection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
index 5475610e1519dbe6fc068debccdaaea972442fee..e768c34b570547f243b4eb26f83c82f044d19700 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.ntp.cards;
+import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ntp.snippets.CategoryStatus.CategoryStatusEnum;
import org.chromium.chrome.browser.ntp.snippets.KnownCategories;
import org.chromium.chrome.browser.ntp.snippets.SnippetArticleListItem;
@@ -32,7 +33,14 @@ public class SuggestionsSection implements ItemGroup {
mHeader = new SnippetHeaderListItem(mInfo.getTitle());
// TODO(pke): Replace the condition with "info.hasMoreButton()" once all other categories
// are supported by the C++ backend, too.
- mMoreButton = (category == KnownCategories.BOOKMARKS) ? new ActionListItem(category) : null;
+ // Right now, we hard-code all the sections that are handled in ActionListItem.
+ boolean showMoreButton = false;
+ if (category == KnownCategories.BOOKMARKS || category == KnownCategories.RECENT_TABS) {
+ showMoreButton = true;
+ } else if (category == KnownCategories.DOWNLOADS) {
+ showMoreButton = ChromeFeatureList.isEnabled("DownloadsUi");
+ }
+ mMoreButton = showMoreButton ? new ActionListItem(category) : null;
setSuggestions(suggestions, status, adapter);
}

Powered by Google App Engine
This is Rietveld 408576698