| 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_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SINK_
H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SINK_
H_ |
| 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SINK_
H_ | 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SINK_
H_ |
| 7 | 7 |
| 8 @class CollectionViewItem; |
| 8 @class ContentSuggestionIdentifier; | 9 @class ContentSuggestionIdentifier; |
| 9 @class ContentSuggestionsSectionInformation; | 10 @class ContentSuggestionsSectionInformation; |
| 10 class GURL; | |
| 11 | 11 |
| 12 // Data sink for the ContentSuggestions. It will be notified when new data needs | 12 // Data sink for the ContentSuggestions. It will be notified when new data needs |
| 13 // to be pulled. | 13 // to be pulled. |
| 14 @protocol ContentSuggestionsDataSink | 14 @protocol ContentSuggestionsDataSink |
| 15 | 15 |
| 16 // Notifies the Data Sink that new data is available for the section identified | 16 // Notifies the Data Sink that new data is available for the section identified |
| 17 // by |sectionInfo|. | 17 // by |sectionInfo|. |
| 18 - (void)dataAvailableForSection: | 18 - (void)dataAvailableForSection: |
| 19 (ContentSuggestionsSectionInformation*)sectionInfo; | 19 (ContentSuggestionsSectionInformation*)sectionInfo; |
| 20 | 20 |
| 21 // The suggestion associated with |suggestionIdentifier| has been invalidated by | 21 // The suggestion associated with |suggestionIdentifier| has been invalidated by |
| 22 // the backend data source and should be cleared now. This is why this method is | 22 // the backend data source and should be cleared now. This is why this method is |
| 23 // about the data source pushing something to the data sink. | 23 // about the data source pushing something to the data sink. |
| 24 - (void)clearSuggestion:(ContentSuggestionIdentifier*)suggestionIdentifier; | 24 - (void)clearSuggestion:(ContentSuggestionIdentifier*)suggestionIdentifier; |
| 25 | 25 |
| 26 // Notifies the Data Sink that it must remove all current data and reload new | 26 // Notifies the Data Sink that it must remove all current data and reload new |
| 27 // ones. | 27 // ones. |
| 28 - (void)reloadAllData; | 28 - (void)reloadAllData; |
| 29 | 29 |
| 30 // The section corresponding to |sectionInfo| has been invalidated and must be | 30 // The section corresponding to |sectionInfo| has been invalidated and must be |
| 31 // cleared now. This is why this method is about the data source pushing | 31 // cleared now. This is why this method is about the data source pushing |
| 32 // something to the data sink. | 32 // something to the data sink. |
| 33 - (void)clearSection:(ContentSuggestionsSectionInformation*)sectionInfo; | 33 - (void)clearSection:(ContentSuggestionsSectionInformation*)sectionInfo; |
| 34 | 34 |
| 35 // The content of the section corresponding to |sectionInfo| must be reloaded | 35 // The content of the section corresponding to |sectionInfo| must be reloaded |
| 36 // now, removing the current content. | 36 // now, removing the current content. |
| 37 - (void)reloadSection:(ContentSuggestionsSectionInformation*)sectionInfo; | 37 - (void)reloadSection:(ContentSuggestionsSectionInformation*)sectionInfo; |
| 38 | 38 |
| 39 // Notifies the Data Sink that a new favicon is available for the |URL|. | 39 // Notifies the Data Sink that a new favicon is available for the |item|. |
| 40 - (void)faviconAvailableForURL:(const GURL&)URL; | 40 - (void)faviconAvailableForItem:(CollectionViewItem<SuggestedContent>*)item; |
| 41 | 41 |
| 42 @end | 42 @end |
| 43 | 43 |
| 44 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SI
NK_H_ | 44 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SI
NK_H_ |
| OLD | NEW |