| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef IOS_CLEAN_CHROME_BROWSER_UI_TAB_COLLECTION_TAB_COLLECTION_CONSUMER_H_ | 5 #ifndef IOS_CLEAN_CHROME_BROWSER_UI_TAB_COLLECTION_TAB_COLLECTION_CONSUMER_H_ |
| 6 #define IOS_CLEAN_CHROME_BROWSER_UI_TAB_COLLECTION_TAB_COLLECTION_CONSUMER_H_ | 6 #define IOS_CLEAN_CHROME_BROWSER_UI_TAB_COLLECTION_TAB_COLLECTION_CONSUMER_H_ |
| 7 | 7 |
| 8 @class TabCollectionItem; | 8 @class TabCollectionItem; |
| 9 | 9 |
| 10 // Interface to support insert/delete/updates to a tab collection. | 10 // Interface to support insert/delete/updates to a tab collection. |
| 11 @protocol TabCollectionConsumer | 11 @protocol TabCollectionConsumer |
| 12 | 12 |
| 13 // Inserts |item| into tab collection at |index|. | 13 // Inserts |item| into tab collection at |index|. |SelectedIndex| is the index |
| 14 - (void)insertItem:(TabCollectionItem*)item atIndex:(int)index; | 14 // of the selected item in the tab collection. |
| 15 - (void)insertItem:(TabCollectionItem*)item |
| 16 atIndex:(int)index |
| 17 selectedIndex:(int)selectedIndex; |
| 15 | 18 |
| 16 // Deletes |index| from tab collection. | 19 // Deletes |index| from tab collection. |SelectedIndex| is the index |
| 17 - (void)deleteItemAtIndex:(int)index; | 20 // of the selected tab in the tab collection. |
| 21 - (void)deleteItemAtIndex:(int)index selectedIndex:(int)selectedIndex; |
| 18 | 22 |
| 19 // Moves item from |fromIndex| to |toIndex|. | 23 // Moves item from |fromIndex| to |toIndex|. |SelectedIndex| is the index |
| 20 - (void)moveItemFromIndex:(int)fromIndex toIndex:(int)toIndex; | 24 // of the selected tab in the tab collection. |
| 25 - (void)moveItemFromIndex:(int)fromIndex |
| 26 toIndex:(int)toIndex |
| 27 selectedIndex:(int)selectedIndex; |
| 21 | 28 |
| 22 // Replaces item at |index| with |item|. | 29 // Replaces item at |index| with |item|. |
| 23 - (void)replaceItemAtIndex:(int)index withItem:(TabCollectionItem*)item; | 30 - (void)replaceItemAtIndex:(int)index withItem:(TabCollectionItem*)item; |
| 24 | 31 |
| 25 // Selects the item at |index|. | 32 // Selects the item at |selectedIndex|. |
| 26 - (void)selectItemAtIndex:(int)index; | 33 - (void)setSelectedIndex:(int)selectedIndex; |
| 27 | 34 |
| 28 // Populates tab collection with |items|. | 35 // Populates tab collection with |items|. |SelectedIndex| is the index |
| 29 - (void)populateItems:(NSArray<TabCollectionItem*>*)items; | 36 // of the selected item in the tab collection. |
| 37 - (void)populateItems:(NSArray<TabCollectionItem*>*)items |
| 38 selectedIndex:(int)selectedIndex; |
| 30 @end | 39 @end |
| 31 | 40 |
| 32 #endif // IOS_CLEAN_CHROME_BROWSER_UI_TAB_COLLECTION_TAB_COLLECTION_CONSUMER_H_ | 41 #endif // IOS_CLEAN_CHROME_BROWSER_UI_TAB_COLLECTION_TAB_COLLECTION_CONSUMER_H_ |
| OLD | NEW |