| 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 #include "components/ntp_snippets/offline_pages/offline_page_suggestions_provide
r.h" | 5 #include "components/ntp_snippets/offline_pages/offline_page_suggestions_provide
r.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus( | 50 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus( |
| 51 Category category) { | 51 Category category) { |
| 52 DCHECK_EQ(category, provided_category_); | 52 DCHECK_EQ(category, provided_category_); |
| 53 return category_status_; | 53 return category_status_; |
| 54 } | 54 } |
| 55 | 55 |
| 56 CategoryInfo OfflinePageSuggestionsProvider::GetCategoryInfo( | 56 CategoryInfo OfflinePageSuggestionsProvider::GetCategoryInfo( |
| 57 Category category) { | 57 Category category) { |
| 58 // TODO(pke): Use the proper string once it's agreed on. | 58 // TODO(pke): Use the proper string once it's agreed on. |
| 59 return CategoryInfo(base::ASCIIToUTF16("Offline pages"), | 59 return CategoryInfo(base::ASCIIToUTF16("Offline pages"), |
| 60 ContentSuggestionsCardLayout::MINIMAL_CARD); | 60 ContentSuggestionsCardLayout::MINIMAL_CARD, false); |
| 61 } |
| 62 |
| 63 void OfflinePageSuggestionsProvider::FetchMoreSuggestions(Category category) { |
| 64 // Ignored. |
| 61 } | 65 } |
| 62 | 66 |
| 63 void OfflinePageSuggestionsProvider::DismissSuggestion( | 67 void OfflinePageSuggestionsProvider::DismissSuggestion( |
| 64 const std::string& suggestion_id) { | 68 const std::string& suggestion_id) { |
| 65 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, | 69 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, |
| 66 // then also implement ClearDismissedSuggestionsForDebugging. | 70 // then also implement ClearDismissedSuggestionsForDebugging. |
| 67 } | 71 } |
| 68 | 72 |
| 69 void OfflinePageSuggestionsProvider::FetchSuggestionImage( | 73 void OfflinePageSuggestionsProvider::FetchSuggestionImage( |
| 70 const std::string& suggestion_id, | 74 const std::string& suggestion_id, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void OfflinePageSuggestionsProvider::NotifyStatusChanged( | 154 void OfflinePageSuggestionsProvider::NotifyStatusChanged( |
| 151 CategoryStatus new_status) { | 155 CategoryStatus new_status) { |
| 152 if (category_status_ == new_status) | 156 if (category_status_ == new_status) |
| 153 return; | 157 return; |
| 154 category_status_ = new_status; | 158 category_status_ = new_status; |
| 155 | 159 |
| 156 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 160 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 157 } | 161 } |
| 158 | 162 |
| 159 } // namespace ntp_snippets | 163 } // namespace ntp_snippets |
| OLD | NEW |