| 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_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H_ | 5 #ifndef IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H_ |
| 6 #define IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H_ | 6 #define IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" | 12 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" |
| 11 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sour
ce.h" | 13 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sour
ce.h" |
| 12 | 14 |
| 13 namespace favicon { | 15 namespace favicon { |
| 14 class LargeIconService; | 16 class LargeIconService; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace ntp_snippets { | 19 namespace ntp_snippets { |
| 18 class ContentSuggestionsService; | 20 class ContentSuggestionsService; |
| 19 } | 21 } |
| 20 | 22 |
| 23 namespace ntp_tiles { |
| 24 class MostVisitedSites; |
| 25 } |
| 26 |
| 21 @protocol ContentSuggestionsCommands; | 27 @protocol ContentSuggestionsCommands; |
| 22 @class ContentSuggestionIdentifier; | 28 @class ContentSuggestionIdentifier; |
| 23 | 29 |
| 24 // Mediator for ContentSuggestions. Makes the interface between a | 30 // Mediator for ContentSuggestions. Makes the interface between a |
| 25 // ntp_snippets::ContentSuggestionsService and the Objective-C services using | 31 // ntp_snippets::ContentSuggestionsService and the Objective-C services using |
| 26 // its data. | 32 // its data. |
| 27 @interface ContentSuggestionsMediator : NSObject<ContentSuggestionsDataSource> | 33 @interface ContentSuggestionsMediator : NSObject<ContentSuggestionsDataSource> |
| 28 | 34 |
| 29 // Initialize the mediator with the |contentService| to mediate. | 35 // Initialize the mediator with the |contentService| to mediate. |
| 30 - (nullable instancetype) | 36 - (nullable instancetype) |
| 31 initWithContentService: | 37 initWithContentService: |
| 32 (nonnull ntp_snippets::ContentSuggestionsService*)contentService | 38 (nonnull ntp_snippets::ContentSuggestionsService*)contentService |
| 33 largeIconService:(nonnull favicon::LargeIconService*)largeIconService | 39 largeIconService:(nonnull favicon::LargeIconService*)largeIconService |
| 40 mostVisitedSite: |
| 41 (std::unique_ptr<ntp_tiles::MostVisitedSites>)mostVisitedSites |
| 34 NS_DESIGNATED_INITIALIZER; | 42 NS_DESIGNATED_INITIALIZER; |
| 35 | 43 |
| 36 - (nullable instancetype)init NS_UNAVAILABLE; | 44 - (nullable instancetype)init NS_UNAVAILABLE; |
| 37 | 45 |
| 38 // Command handler for the mediator. | 46 // Command handler for the mediator. |
| 39 @property(nonatomic, weak, nullable) id<ContentSuggestionsCommands> | 47 @property(nonatomic, weak, nullable) id<ContentSuggestionsCommands> |
| 40 commandHandler; | 48 commandHandler; |
| 41 | 49 |
| 42 // Dismisses the suggestion from the content suggestions service. It doesn't | 50 // Dismisses the suggestion from the content suggestions service. It doesn't |
| 43 // change the UI. | 51 // change the UI. |
| 44 - (void)dismissSuggestion: | 52 - (void)dismissSuggestion: |
| 45 (nonnull ContentSuggestionIdentifier*)suggestionIdentifier; | 53 (nonnull ContentSuggestionIdentifier*)suggestionIdentifier; |
| 46 | 54 |
| 47 @end | 55 @end |
| 48 | 56 |
| 49 #endif // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H
_ | 57 #endif // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H
_ |
| OLD | NEW |