| 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 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" | 5 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" |
| 6 | 6 |
| 7 #include "base/mac/bind_objc_block.h" | 7 #include "base/mac/bind_objc_block.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 ContentSuggestionIdentifier* suggestionIdentifier = | 206 ContentSuggestionIdentifier* suggestionIdentifier = |
| 207 [[ContentSuggestionIdentifier alloc] init]; | 207 [[ContentSuggestionIdentifier alloc] init]; |
| 208 suggestionIdentifier.IDInSection = suggestion_id.id_within_category(); | 208 suggestionIdentifier.IDInSection = suggestion_id.id_within_category(); |
| 209 suggestionIdentifier.sectionInfo = self.sectionInformationByCategory[wrapper]; | 209 suggestionIdentifier.sectionInfo = self.sectionInformationByCategory[wrapper]; |
| 210 | 210 |
| 211 [self.dataSink clearSuggestion:suggestionIdentifier]; | 211 [self.dataSink clearSuggestion:suggestionIdentifier]; |
| 212 } | 212 } |
| 213 | 213 |
| 214 - (void)contentSuggestionsServiceFullRefreshRequired: | 214 - (void)contentSuggestionsServiceFullRefreshRequired: |
| 215 (ntp_snippets::ContentSuggestionsService*)suggestionsService { | 215 (ntp_snippets::ContentSuggestionsService*)suggestionsService { |
| 216 // Update dataSink. | 216 [self.dataSink reloadAllData]; |
| 217 } | 217 } |
| 218 | 218 |
| 219 - (void)contentSuggestionsServiceShutdown: | 219 - (void)contentSuggestionsServiceShutdown: |
| 220 (ntp_snippets::ContentSuggestionsService*)suggestionsService { | 220 (ntp_snippets::ContentSuggestionsService*)suggestionsService { |
| 221 // Update dataSink. | 221 // Update dataSink. |
| 222 } | 222 } |
| 223 | 223 |
| 224 #pragma mark - ContentSuggestionsImageFetcher | 224 #pragma mark - ContentSuggestionsImageFetcher |
| 225 | 225 |
| 226 - (void)fetchImageForSuggestion: | 226 - (void)fetchImageForSuggestion: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 wrapperWithCategory:category]] = sectionInfo; | 262 wrapperWithCategory:category]] = sectionInfo; |
| 263 } | 263 } |
| 264 | 264 |
| 265 - (ContentSuggestionsCategoryWrapper*)categoryWrapperForSectionInfo: | 265 - (ContentSuggestionsCategoryWrapper*)categoryWrapperForSectionInfo: |
| 266 (ContentSuggestionsSectionInformation*)sectionInfo { | 266 (ContentSuggestionsSectionInformation*)sectionInfo { |
| 267 return [[self.sectionInformationByCategory allKeysForObject:sectionInfo] | 267 return [[self.sectionInformationByCategory allKeysForObject:sectionInfo] |
| 268 firstObject]; | 268 firstObject]; |
| 269 } | 269 } |
| 270 | 270 |
| 271 @end | 271 @end |
| OLD | NEW |