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/reading_list/reading_list_collection_view_item.h" | 5 #import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_item.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" | 8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
9 #import "ios/chrome/browser/ui/favicon_view.h" | 9 #import "ios/chrome/browser/ui/favicon_view.h" |
10 #import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_item_ac
cessibility_delegate.h" | 10 #import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_item_ac
cessibility_delegate.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 return self; | 353 return self; |
354 } | 354 } |
355 | 355 |
356 - (void)setDistillationState: | 356 - (void)setDistillationState: |
357 (ReadingListEntry::DistillationState)distillationState { | 357 (ReadingListEntry::DistillationState)distillationState { |
358 if (_distillationState == distillationState) | 358 if (_distillationState == distillationState) |
359 return; | 359 return; |
360 | 360 |
361 _distillationState = distillationState; | 361 _distillationState = distillationState; |
362 switch (distillationState) { | 362 switch (distillationState) { |
363 case ReadingListEntry::ERROR: | 363 case ReadingListEntry::DISTILLATION_ERROR: |
364 [_downloadIndicator setImage:[UIImage imageNamed:kFailureImageString]]; | 364 [_downloadIndicator setImage:[UIImage imageNamed:kFailureImageString]]; |
365 break; | 365 break; |
366 | 366 |
367 case ReadingListEntry::PROCESSED: | 367 case ReadingListEntry::PROCESSED: |
368 [_downloadIndicator setImage:[UIImage imageNamed:kSuccessImageString]]; | 368 [_downloadIndicator setImage:[UIImage imageNamed:kSuccessImageString]]; |
369 break; | 369 break; |
370 | 370 |
371 // Same behavior for all pre-download states. | 371 // Same behavior for all pre-download states. |
372 case ReadingListEntry::WAITING: | 372 case ReadingListEntry::WAITING: |
373 case ReadingListEntry::WILL_RETRY: | 373 case ReadingListEntry::WILL_RETRY: |
374 case ReadingListEntry::PROCESSING: | 374 case ReadingListEntry::PROCESSING: |
375 [_downloadIndicator setImage:nil]; | 375 [_downloadIndicator setImage:nil]; |
376 break; | 376 break; |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 #pragma mark - UICollectionViewCell | 380 #pragma mark - UICollectionViewCell |
381 | 381 |
382 - (void)prepareForReuse { | 382 - (void)prepareForReuse { |
383 [self.delegate readingListCellWillPrepareForReload:self]; | 383 [self.delegate readingListCellWillPrepareForReload:self]; |
384 self.delegate = nil; | 384 self.delegate = nil; |
385 self.textLabel.text = nil; | 385 self.textLabel.text = nil; |
386 self.detailTextLabel.text = nil; | 386 self.detailTextLabel.text = nil; |
387 self.distillationState = ReadingListEntry::WAITING; | 387 self.distillationState = ReadingListEntry::WAITING; |
388 self.accessibilityCustomActions = nil; | 388 self.accessibilityCustomActions = nil; |
389 [super prepareForReuse]; | 389 [super prepareForReuse]; |
390 } | 390 } |
391 | 391 |
392 @end | 392 @end |
OLD | NEW |