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