Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: components/ntp_snippets/reading_list/reading_list_distillation_state_util.cc

Issue 2865183003: Use the same design for all suggestions (Closed)
Patch Set: Address comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/reading_list/reading_list_distillation_state_util.cc
diff --git a/components/ntp_snippets/reading_list/reading_list_distillation_state_util.cc b/components/ntp_snippets/reading_list/reading_list_distillation_state_util.cc
deleted file mode 100644
index e7361ad130021f50bf2f4666572c3c32e8d713b0..0000000000000000000000000000000000000000
--- a/components/ntp_snippets/reading_list/reading_list_distillation_state_util.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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.
-
-#include "components/ntp_snippets/reading_list/reading_list_distillation_state_util.h"
-
-#include "base/logging.h"
-
-namespace ntp_snippets {
-
-ReadingListEntry::DistillationState ReadingListStateFromSuggestionState(
- ReadingListSuggestionExtra::ReadingListSuggestionDistilledState
- distilled_state) {
- switch (distilled_state) {
- case ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- PENDING:
- return ReadingListEntry::WAITING;
- case ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- SUCCESS:
- return ReadingListEntry::PROCESSED;
- case ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- FAILURE:
- return ReadingListEntry::DISTILLATION_ERROR;
- }
- NOTREACHED();
- return ReadingListEntry::PROCESSING;
-}
-
-ReadingListSuggestionExtra::ReadingListSuggestionDistilledState
-SuggestionStateFromReadingListState(
- ReadingListEntry::DistillationState distilled_state) {
- switch (distilled_state) {
- case ReadingListEntry::WILL_RETRY:
- case ReadingListEntry::PROCESSING:
- case ReadingListEntry::WAITING:
- return ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- PENDING;
- case ReadingListEntry::PROCESSED:
- return ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- SUCCESS;
- case ReadingListEntry::DISTILLATION_ERROR:
- return ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- FAILURE;
- }
- NOTREACHED();
- return ReadingListSuggestionExtra::ReadingListSuggestionDistilledState::
- PENDING;
-}
-
-} // namespace ntp_snippets

Powered by Google App Engine
This is Rietveld 408576698