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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionItem.java

Issue 2860463002: [Suggestions] Remove TreeNode.getSuggestionAt() in favor of a visitor. (Closed)
Patch Set: review Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698