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