Chromium Code Reviews| Index: ios/chrome/browser/ui/reading_list/reading_list_utils.mm |
| diff --git a/ios/chrome/browser/ui/reading_list/reading_list_utils.mm b/ios/chrome/browser/ui/reading_list/reading_list_utils.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6d80d6349eff82756e6da0cc9938549645bc2ec6 |
| --- /dev/null |
| +++ b/ios/chrome/browser/ui/reading_list/reading_list_utils.mm |
| @@ -0,0 +1,23 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "ios/chrome/browser/ui/reading_list/reading_list_utils.h" |
| + |
| +#if !defined(__has_feature) || !__has_feature(objc_arc) |
| +#error "This file requires ARC support." |
| +#endif |
| + |
| +ReadingListUIDistillationStatus UIStatusFromModelStatus( |
| + ReadingListEntry::DistillationState distillation_state) { |
| + switch (distillation_state) { |
|
lpromero
2017/03/30 12:58:27
Nice. So it was not even 1:1 in our use case.
|
| + case ReadingListEntry::WILL_RETRY: |
| + case ReadingListEntry::PROCESSING: |
| + case ReadingListEntry::WAITING: |
| + return ReadingListUIDistillationStatusPending; |
| + case ReadingListEntry::PROCESSED: |
| + return ReadingListUIDistillationStatusSuccess; |
| + case ReadingListEntry::DISTILLATION_ERROR: |
| + return ReadingListUIDistillationStatusFailure; |
| + } |
| +} |