Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_CATEGORY_INFO_H_ | |
| 6 #define COMPONENTS_NTP_SNIPPETS_CATEGORY_INFO_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/strings/string16.h" | |
| 10 | |
| 11 namespace ntp_snippets { | |
| 12 | |
| 13 // On Android builds, a Java counterpart will be generated for this enum. | |
| 14 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ntp.snippets | |
| 15 enum class ContentSuggestionsCardLayout { | |
|
PEConn
2016/08/08 13:50:04
Was there more of a discussion about this approach
| |
| 16 // Uses all fields. | |
| 17 FULL_CARD, | |
| 18 | |
| 19 // No snippet_text and no thumbnail image. | |
| 20 MINIMAL_CARD | |
| 21 }; | |
| 22 | |
| 23 // Contains static meta information about a Category. | |
| 24 class CategoryInfo { | |
| 25 public: | |
| 26 CategoryInfo(const base::string16& title, | |
| 27 ContentSuggestionsCardLayout card_layout); | |
| 28 CategoryInfo(CategoryInfo&&) = default; | |
| 29 CategoryInfo& operator=(CategoryInfo&&) = default; | |
| 30 | |
| 31 ~CategoryInfo(); | |
| 32 | |
| 33 // Localized title of the category. | |
| 34 const base::string16& title() const { return title_; } | |
| 35 | |
| 36 // Layout of the cards to be used to display suggestions in this category. | |
| 37 ContentSuggestionsCardLayout card_layout() const { return card_layout_; } | |
| 38 | |
| 39 private: | |
| 40 base::string16 title_; | |
| 41 ContentSuggestionsCardLayout card_layout_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(CategoryInfo); | |
| 44 }; | |
| 45 | |
| 46 } // namespace ntp_snippets | |
| 47 | |
| 48 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_INFO_H_ | |
| OLD | NEW |