OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 package org.chromium.chrome.browser.ntp.cards; |
| 6 |
| 7 import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; |
| 8 import org.chromium.chrome.browser.suggestions.ContentSuggestionsAdditionalActio
n; |
| 9 |
| 10 /** |
| 11 * Allows implementing a visitor pattern to iterate over all items under a (sub-
)tree. |
| 12 */ |
| 13 public class NodeVisitor { |
| 14 /** |
| 15 * Visits the above-the-fold item. |
| 16 */ |
| 17 public void visitAboveTheFoldItem() {} |
| 18 |
| 19 /** |
| 20 * Visits an action item. |
| 21 * @param currentAction The action enum value for the item. |
| 22 */ |
| 23 public void visitActionItem(@ContentSuggestionsAdditionalAction int currentA
ction) {} |
| 24 |
| 25 /** |
| 26 * Visits the "all dimissed" item. |
| 27 */ |
| 28 public void visitAllDismissedItem() {} |
| 29 |
| 30 /** |
| 31 * Visits the footer. |
| 32 */ |
| 33 public void visitFooter() {} |
| 34 |
| 35 /** |
| 36 * Visits a progress item. |
| 37 */ |
| 38 public void visitProgressItem() {} |
| 39 |
| 40 /** |
| 41 * Visits a sign-in promo. |
| 42 */ |
| 43 public void visitSignInPromo() {} |
| 44 |
| 45 /** |
| 46 * Visits a spacing item. |
| 47 */ |
| 48 public void visitSpacingItem() {} |
| 49 |
| 50 /** |
| 51 * Visits a "no suggestions" item. |
| 52 */ |
| 53 public void visitNoSuggestionsItem() {} |
| 54 |
| 55 /** |
| 56 * Visits a suggestion. |
| 57 * @param suggestion The {@link SnippetArticle} represented by the item. |
| 58 */ |
| 59 public void visitSuggestion(SnippetArticle suggestion) {} |
| 60 |
| 61 /** |
| 62 * Visits a header. |
| 63 */ |
| 64 public void visitHeader() {} |
| 65 |
| 66 /** |
| 67 * Visits the tile grid. |
| 68 */ |
| 69 public void visitTileGrid() {} |
| 70 } |
OLD | NEW |