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

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

Issue 2398463005: Revert of 📰 Use the separate button style for the NoArticles status (Closed)
Patch Set: Created 4 years, 2 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/SuggestionsCategoryInfo.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
index 7872f7b2e2070de3481e26b76d80eb168eb41ec6..967a10929f81fab38ee46d3c4b6ee6f8c18f5dd5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
@@ -4,29 +4,13 @@
package org.chromium.chrome.browser.ntp.cards;
-import android.support.annotation.StringRes;
-
-import org.chromium.base.Log;
-import org.chromium.chrome.R;
-import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
-import org.chromium.chrome.browser.ntp.snippets.CategoryInt;
import org.chromium.chrome.browser.ntp.snippets.ContentSuggestionsCardLayout.ContentSuggestionsCardLayoutEnum;
-import org.chromium.chrome.browser.ntp.snippets.KnownCategories;
-
/**
- * Contains meta information about a Category. Equivalent of the CategoryInfo class in
+ * Contains static meta information about a Category. Equivalent of the CategoryInfo class in
* components/ntp_snippets/category_info.h.
*/
public class SuggestionsCategoryInfo {
- private static final String TAG = "NtpCards";
-
- /**
- * Id of the category.
- */
- @CategoryInt
- private final int mCategory;
-
/**
* Localized title of the category.
*/
@@ -48,10 +32,8 @@
/** Whether this category should be shown if it offers no suggestions. */
private final boolean mShowIfEmpty;
- public SuggestionsCategoryInfo(@CategoryInt int category, String title,
- @ContentSuggestionsCardLayoutEnum int cardLayout, boolean hasMoreButton,
- boolean showIfEmpty) {
- mCategory = category;
+ public SuggestionsCategoryInfo(String title, @ContentSuggestionsCardLayoutEnum int cardLayout,
+ boolean hasMoreButton, boolean showIfEmpty) {
mTitle = title;
mCardLayout = cardLayout;
mHasMoreButton = hasMoreButton;
@@ -60,11 +42,6 @@
public String getTitle() {
return mTitle;
- }
-
- @CategoryInt
- public int getCategory() {
- return mCategory;
}
@ContentSuggestionsCardLayoutEnum
@@ -79,46 +56,4 @@
public boolean showIfEmpty() {
return mShowIfEmpty;
}
-
- /**
- * Performs the appropriate action for the provided category, for the case where there are no
- * suggestions available. In general, this consists in navigating to the view showing all the
- * content, or fetching new content.
- */
- public void performEmptyStateAction(NewTabPageManager manager, NewTabPageAdapter adapter) {
- switch (mCategory) {
- case KnownCategories.ARTICLES:
- adapter.reloadSnippets();
- break;
- case KnownCategories.BOOKMARKS:
- manager.navigateToBookmarks();
- break;
- case KnownCategories.DOWNLOADS:
- manager.navigateToDownloadManager();
- break;
- case KnownCategories.FOREIGN_TABS:
- manager.navigateToRecentTabs();
- break;
- default:
- Log.wtf(TAG, "'Empty State' action called for unsupported category: %d", mCategory);
- break;
- }
- }
-
- /**
- * Returns the string to use as description for the status card that is displayed when there
- * are no suggestions available for the provided category.
- */
- @StringRes
- public int getNoSuggestionDescription() {
- switch (mCategory) {
- case KnownCategories.ARTICLES:
- return R.string.ntp_status_card_no_articles;
- case KnownCategories.BOOKMARKS:
- return R.string.ntp_status_card_no_bookmarks;
- default:
- Log.wtf(TAG, "Requested description for unsupported category: %d", mCategory);
- return 0;
- }
- }
}

Powered by Google App Engine
This is Rietveld 408576698