Chromium Code Reviews| 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_SOURC E_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SOURC E_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SOURC E_H_ | 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SOURC E_H_ |
| 7 | 7 |
| 8 @class ContentSuggestion; | 8 @class ContentSuggestion; |
| 9 @class ContentSuggestionIdentifier; | |
| 9 @class ContentSuggestionsSectionInformation; | 10 @class ContentSuggestionsSectionInformation; |
| 10 @protocol ContentSuggestionsDataSink; | 11 @protocol ContentSuggestionsDataSink; |
| 11 @protocol ContentSuggestionsImageFetcher; | 12 @protocol ContentSuggestionsImageFetcher; |
| 12 | 13 |
| 14 // Typedef for a block taking the fetched suggestions as parameter. | |
| 15 typedef void (^MoreSuggestionsFetched)(NSArray<ContentSuggestion*>* _Nonnull); | |
| 16 | |
| 13 // DataSource for the content suggestions. Provides the suggestions data in a | 17 // DataSource for the content suggestions. Provides the suggestions data in a |
| 14 // format compatible with Objective-C. | 18 // format compatible with Objective-C. |
| 15 @protocol ContentSuggestionsDataSource | 19 @protocol ContentSuggestionsDataSource |
| 16 | 20 |
| 17 // The data sink that will be notified when the data change. | 21 // The data sink that will be notified when the data change. |
| 18 @property(nonatomic, nullable, weak) id<ContentSuggestionsDataSink> dataSink; | 22 @property(nonatomic, nullable, weak) id<ContentSuggestionsDataSink> dataSink; |
| 19 | 23 |
| 20 // Returns all the data currently available. | 24 // Returns all the data currently available. |
| 21 - (nonnull NSArray<ContentSuggestion*>*)allSuggestions; | 25 - (nonnull NSArray<ContentSuggestion*>*)allSuggestions; |
| 22 | 26 |
| 23 // Returns the data currently available for the section identified by | 27 // Returns the data currently available for the section identified by |
| 24 // |sectionInfo|. | 28 // |sectionInfo|. |
| 25 - (nonnull NSArray<ContentSuggestion*>*)suggestionsForSection: | 29 - (nonnull NSArray<ContentSuggestion*>*)suggestionsForSection: |
| 26 (nonnull ContentSuggestionsSectionInformation*)sectionInfo; | 30 (nonnull ContentSuggestionsSectionInformation*)sectionInfo; |
| 27 | 31 |
| 28 // Returns an image updater for the suggestions provided by this data source. | 32 // Returns an image updater for the suggestions provided by this data source. |
| 29 - (nullable id<ContentSuggestionsImageFetcher>)imageFetcher; | 33 - (nullable id<ContentSuggestionsImageFetcher>)imageFetcher; |
| 30 | 34 |
| 35 // Fetches additional contents. All the |knownSuggestions| must come from the | |
| 36 // same |sectionInfo|. If the fetch was completed, the given |callback| is | |
| 37 // called with the updated content. | |
|
lpromero
2017/03/15 10:18:09
"contents" to match line 35? Can you precise if th
gambard
2017/03/15 13:14:15
Updated.
| |
| 38 - (void)fetchMoreSuggestionsKnowing: | |
| 39 (nullable NSArray<ContentSuggestionIdentifier*>*)knownSuggestions | |
| 40 fromSectionInfo: | |
| 41 (nonnull ContentSuggestionsSectionInformation*) | |
| 42 sectionInfo | |
| 43 callback:(nullable MoreSuggestionsFetched)callback; | |
| 44 | |
| 31 @end | 45 @end |
| 32 | 46 |
| 33 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SO URCE_H_ | 47 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_DATA_SO URCE_H_ |
| OLD | NEW |