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 package org.chromium.chrome.browser.ntp.cards; | |
6 | |
7 import java.util.List; | |
8 | |
9 /** | |
10 * A group of items. | |
11 */ | |
12 public interface ItemGroup { | |
13 /** | |
14 * @return A list of items contained in this group. The list should not be m
odified. | |
15 */ | |
16 List<NewTabPageItem> getItems(); | |
17 | |
18 /** | |
19 * Defines the actions an object can be notified about when there are change
s inside of | |
20 * an {@link ItemGroup}. | |
21 */ | |
22 interface Observer { | |
23 /** Notification about items having been changed in the group. */ | |
24 void onItemRangeChanged(ItemGroup group, int itemPosition, int itemCount
); | |
25 | |
26 /** Notification about items having been added to the group. */ | |
27 void onItemRangeInserted(ItemGroup group, int itemPosition, int itemCoun
t); | |
28 | |
29 /** Notification about items having been removed from the group. */ | |
30 void onItemRangeRemoved(ItemGroup group, int itemPosition, int itemCount
); | |
31 } | |
32 } | |
OLD | NEW |