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

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: Remove more-button for Recent Tabs 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..4e4e4f27bf3443a4c4e2cdb0d0a9854acecf4342 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) {
+ showMoreButton = true;
+ } else if (category == KnownCategories.DOWNLOADS) {
+ showMoreButton = ChromeFeatureList.isEnabled("DownloadsUi");
+ }
+ mMoreButton = showMoreButton ? new ActionListItem(category) : null;
setSuggestions(suggestions, status, adapter);
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698