| 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/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 std::vector<Category> OfflinePageSuggestionsProvider::GetProvidedCategories() { | 43 std::vector<Category> OfflinePageSuggestionsProvider::GetProvidedCategories() { |
| 44 return std::vector<Category>({provided_category_}); | 44 return std::vector<Category>({provided_category_}); |
| 45 } | 45 } |
| 46 | 46 |
| 47 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus( | 47 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus( |
| 48 Category category) { | 48 Category category) { |
| 49 return category_status_; | 49 return category_status_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 CategoryInfo OfflinePageSuggestionsProvider::GetCategoryInfo( |
| 53 Category category) { |
| 54 // TODO(pke): Use the proper string once it's agreed on. |
| 55 return CategoryInfo(base::ASCIIToUTF16("Offline pages")); |
| 56 } |
| 57 |
| 52 void OfflinePageSuggestionsProvider::DismissSuggestion( | 58 void OfflinePageSuggestionsProvider::DismissSuggestion( |
| 53 const std::string& suggestion_id) { | 59 const std::string& suggestion_id) { |
| 54 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, | 60 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, |
| 55 // then also implement ClearDismissedSuggestionsForDebugging. | 61 // then also implement ClearDismissedSuggestionsForDebugging. |
| 56 } | 62 } |
| 57 | 63 |
| 58 void OfflinePageSuggestionsProvider::FetchSuggestionImage( | 64 void OfflinePageSuggestionsProvider::FetchSuggestionImage( |
| 59 const std::string& suggestion_id, | 65 const std::string& suggestion_id, |
| 60 const ImageFetchedCallback& callback) { | 66 const ImageFetchedCallback& callback) { |
| 61 // TODO(pke): Implement. | 67 // TODO(pke): Implement. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void OfflinePageSuggestionsProvider::NotifyStatusChanged( | 130 void OfflinePageSuggestionsProvider::NotifyStatusChanged( |
| 125 CategoryStatus new_status) { | 131 CategoryStatus new_status) { |
| 126 if (category_status_ == new_status) | 132 if (category_status_ == new_status) |
| 127 return; | 133 return; |
| 128 category_status_ = new_status; | 134 category_status_ = new_status; |
| 129 | 135 |
| 130 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 136 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 131 } | 137 } |
| 132 | 138 |
| 133 } // namespace ntp_snippets | 139 } // namespace ntp_snippets |
| OLD | NEW |