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

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

Issue 2230473002: Refactor and extend SnippetsBridge for multi-section support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@categoryinfo
Patch Set: Rename SnippetsObserver to ContentSuggestionsSourceObserver 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/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
new file mode 100644
index 0000000000000000000000000000000000000000..a0127dc3fd4829f408edd1c9702ac1c77d266255
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.ntp.cards;
+
+import org.chromium.chrome.browser.ntp.snippets.ContentSuggestionsCardLayout.ContentSuggestionsCardLayoutEnum;
+
+/**
+ * Contains static meta information about a Category. Equivalent of the CategoryInfo class in
+ * components/ntp_snippets/category_info.h.
+ */
+public class SuggestionsCategoryInfo {
+ /**
+ * Localized title of the category.
+ */
+ private final String mTitle;
+
+ /**
+ * Layout of the cards to be used to display suggestions in this category.
+ */
+ @ContentSuggestionsCardLayoutEnum
+ private final int mCardLayout;
+
+ public SuggestionsCategoryInfo(String title, @ContentSuggestionsCardLayoutEnum int cardLayout) {
+ this.mTitle = title;
+ this.mCardLayout = cardLayout;
+ }
+
+ public String getTitle() {
+ return this.mTitle;
+ }
+
+ public int getCardLayout() {
+ return this.mCardLayout;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698