| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.ntp.cards; | 5 package org.chromium.chrome.browser.ntp.cards; |
| 6 | 6 |
| 7 import android.view.View; | 7 import android.view.View; |
| 8 | 8 |
| 9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
| 10 import org.chromium.chrome.R; | 10 import org.chromium.chrome.R; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 return ItemViewType.ACTION; | 40 return ItemViewType.ACTION; |
| 41 } | 41 } |
| 42 | 42 |
| 43 @Override | 43 @Override |
| 44 protected void onBindViewHolder(NewTabPageViewHolder holder) { | 44 protected void onBindViewHolder(NewTabPageViewHolder holder) { |
| 45 assert holder instanceof ViewHolder; | 45 assert holder instanceof ViewHolder; |
| 46 mSuggestionsRanker.rankActionItem(this, mParentSection); | 46 mSuggestionsRanker.rankActionItem(this, mParentSection); |
| 47 ((ViewHolder) holder).onBindViewHolder(this); | 47 ((ViewHolder) holder).onBindViewHolder(this); |
| 48 } | 48 } |
| 49 | 49 |
| 50 @Override |
| 51 public void visitOptionalItem(NodeVisitor visitor) { |
| 52 visitor.visitActionItem(mCategoryInfo.getAdditionalAction()); |
| 53 } |
| 54 |
| 50 @CategoryInt | 55 @CategoryInt |
| 51 public int getCategory() { | 56 public int getCategory() { |
| 52 return mCategoryInfo.getCategory(); | 57 return mCategoryInfo.getCategory(); |
| 53 } | 58 } |
| 54 | 59 |
| 55 public void setPerSectionRank(int perSectionRank) { | 60 public void setPerSectionRank(int perSectionRank) { |
| 56 mPerSectionRank = perSectionRank; | 61 mPerSectionRank = perSectionRank; |
| 57 } | 62 } |
| 58 | 63 |
| 59 public int getPerSectionRank() { | 64 public int getPerSectionRank() { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 113 } |
| 109 }); | 114 }); |
| 110 } | 115 } |
| 111 | 116 |
| 112 public void onBindViewHolder(ActionItem item) { | 117 public void onBindViewHolder(ActionItem item) { |
| 113 super.onBindViewHolder(); | 118 super.onBindViewHolder(); |
| 114 mActionListItem = item; | 119 mActionListItem = item; |
| 115 } | 120 } |
| 116 } | 121 } |
| 117 } | 122 } |
| OLD | NEW |