| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/content_suggestions/content_suggestions_collectio
n_updater.h" | 5 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collectio
n_updater.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 NSIndexPath* addedIndexPath = [self addItem:articleItem | 267 NSIndexPath* addedIndexPath = [self addItem:articleItem |
| 268 toSectionWithIdentifier:sectionIdentifier]; | 268 toSectionWithIdentifier:sectionIdentifier]; |
| 269 [indexPaths addObject:addedIndexPath]; | 269 [indexPaths addObject:addedIndexPath]; |
| 270 break; | 270 break; |
| 271 } | 271 } |
| 272 case ContentSuggestionTypeReadingList: { | 272 case ContentSuggestionTypeReadingList: { |
| 273 ContentSuggestionsReadingListItem* readingListItem = | 273 ContentSuggestionsReadingListItem* readingListItem = |
| 274 [[ContentSuggestionsReadingListItem alloc] | 274 [[ContentSuggestionsReadingListItem alloc] |
| 275 initWithType:ItemTypeReadingList | 275 initWithType:ItemTypeReadingList |
| 276 url:suggestion.url | 276 url:suggestion.url |
| 277 distillationState:ReadingListEntry::PROCESSING]; | 277 distillationState:ReadingListUIDistillationStatusPending]; |
| 278 readingListItem.title = suggestion.title; | 278 readingListItem.title = suggestion.title; |
| 279 readingListItem.subtitle = suggestion.publisher; | 279 readingListItem.subtitle = suggestion.publisher; |
| 280 | 280 |
| 281 readingListItem.suggestionIdentifier = suggestion.suggestionIdentifier; | 281 readingListItem.suggestionIdentifier = suggestion.suggestionIdentifier; |
| 282 | 282 |
| 283 NSIndexPath* addedIndexPath = [self addItem:readingListItem | 283 NSIndexPath* addedIndexPath = [self addItem:readingListItem |
| 284 toSectionWithIdentifier:sectionIdentifier]; | 284 toSectionWithIdentifier:sectionIdentifier]; |
| 285 [indexPaths addObject:addedIndexPath]; | 285 [indexPaths addObject:addedIndexPath]; |
| 286 break; | 286 break; |
| 287 } | 287 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 CSCollectionViewModel* model = | 456 CSCollectionViewModel* model = |
| 457 self.collectionViewController.collectionViewModel; | 457 self.collectionViewController.collectionViewModel; |
| 458 NSInteger section = [model sectionForSectionIdentifier:sectionIdentifier]; | 458 NSInteger section = [model sectionForSectionIdentifier:sectionIdentifier]; |
| 459 NSInteger itemNumber = [model numberOfItemsInSection:section]; | 459 NSInteger itemNumber = [model numberOfItemsInSection:section]; |
| 460 [model addItem:item toSectionWithIdentifier:sectionIdentifier]; | 460 [model addItem:item toSectionWithIdentifier:sectionIdentifier]; |
| 461 | 461 |
| 462 return [NSIndexPath indexPathForItem:itemNumber inSection:section]; | 462 return [NSIndexPath indexPathForItem:itemNumber inSection:section]; |
| 463 } | 463 } |
| 464 | 464 |
| 465 @end | 465 @end |
| OLD | NEW |