| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 - (void)contentSuggestionsService: | 192 - (void)contentSuggestionsService: |
| 193 (ntp_snippets::ContentSuggestionsService*)suggestionsService | 193 (ntp_snippets::ContentSuggestionsService*)suggestionsService |
| 194 category:(ntp_snippets::Category)category | 194 category:(ntp_snippets::Category)category |
| 195 statusChangedTo:(ntp_snippets::CategoryStatus)status { | 195 statusChangedTo:(ntp_snippets::CategoryStatus)status { |
| 196 // Update dataSink. | 196 // Update dataSink. |
| 197 } | 197 } |
| 198 | 198 |
| 199 - (void)contentSuggestionsService: | 199 - (void)contentSuggestionsService: |
| 200 (ntp_snippets::ContentSuggestionsService*)suggestionsService | 200 (ntp_snippets::ContentSuggestionsService*)suggestionsService |
| 201 SuggestionInvalidated: | 201 suggestionInvalidated: |
| 202 (const ntp_snippets::ContentSuggestion::ID&)suggestion_id { | 202 (const ntp_snippets::ContentSuggestion::ID&)suggestion_id { |
| 203 // Update dataSink. | 203 ContentSuggestionsCategoryWrapper* wrapper = |
| 204 [[ContentSuggestionsCategoryWrapper alloc] |
| 205 initWithCategory:suggestion_id.category()]; |
| 206 ContentSuggestionIdentifier* suggestionIdentifier = |
| 207 [[ContentSuggestionIdentifier alloc] init]; |
| 208 suggestionIdentifier.IDInSection = suggestion_id.id_within_category(); |
| 209 suggestionIdentifier.sectionInfo = self.sectionInformationByCategory[wrapper]; |
| 210 |
| 211 [self.dataSink clearSuggestion:suggestionIdentifier]; |
| 204 } | 212 } |
| 205 | 213 |
| 206 - (void)contentSuggestionsServiceFullRefreshRequired: | 214 - (void)contentSuggestionsServiceFullRefreshRequired: |
| 207 (ntp_snippets::ContentSuggestionsService*)suggestionsService { | 215 (ntp_snippets::ContentSuggestionsService*)suggestionsService { |
| 208 // Update dataSink. | 216 // Update dataSink. |
| 209 } | 217 } |
| 210 | 218 |
| 211 - (void)contentSuggestionsServiceShutdown: | 219 - (void)contentSuggestionsServiceShutdown: |
| 212 (ntp_snippets::ContentSuggestionsService*)suggestionsService { | 220 (ntp_snippets::ContentSuggestionsService*)suggestionsService { |
| 213 // Update dataSink. | 221 // Update dataSink. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 wrapperWithCategory:category]] = sectionInfo; | 262 wrapperWithCategory:category]] = sectionInfo; |
| 255 } | 263 } |
| 256 | 264 |
| 257 - (ContentSuggestionsCategoryWrapper*)categoryWrapperForSectionInfo: | 265 - (ContentSuggestionsCategoryWrapper*)categoryWrapperForSectionInfo: |
| 258 (ContentSuggestionsSectionInformation*)sectionInfo { | 266 (ContentSuggestionsSectionInformation*)sectionInfo { |
| 259 return [[self.sectionInformationByCategory allKeysForObject:sectionInfo] | 267 return [[self.sectionInformationByCategory allKeysForObject:sectionInfo] |
| 260 firstObject]; | 268 firstObject]; |
| 261 } | 269 } |
| 262 | 270 |
| 263 @end | 271 @end |
| OLD | NEW |