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 /** | 7 /** |
8 * Represents a progress indicator for the recycler view. A visibility flag can
be set to be used | 8 * Represents a progress indicator for the recycler view. A visibility flag can
be set to be used |
9 * by its associated view holder when it is bound. | 9 * by its associated view holder when it is bound. |
10 * | 10 * |
11 * @see ProgressViewHolder | 11 * @see ProgressViewHolder |
12 */ | 12 */ |
13 class ProgressItem extends OptionalLeaf { | 13 class ProgressItem extends OptionalLeaf { |
14 | 14 |
15 @Override | 15 @Override |
16 @ItemViewType | 16 @ItemViewType |
17 protected int getItemViewType() { | 17 protected int getItemViewType() { |
18 return ItemViewType.PROGRESS; | 18 return ItemViewType.PROGRESS; |
19 } | 19 } |
20 | 20 |
21 @Override | 21 @Override |
22 protected void onBindViewHolder(NewTabPageViewHolder holder) { | 22 protected void onBindViewHolder(NewTabPageViewHolder holder) { |
23 assert holder instanceof ProgressViewHolder; | 23 assert holder instanceof ProgressViewHolder; |
24 ((ProgressViewHolder) holder).onBindViewHolder(this); | 24 ((ProgressViewHolder) holder).onBindViewHolder(this); |
25 } | 25 } |
| 26 |
| 27 @Override |
| 28 protected void visitOptionalItem(NodeVisitor visitor) { |
| 29 visitor.visitProgressItem(); |
| 30 } |
26 } | 31 } |
OLD | NEW |