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 | 9 |
10 using offline_pages::MultipleOfflinePageItemResult; | 10 using offline_pages::MultipleOfflinePageItemResult; |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (observer) | 39 if (observer) |
40 FetchOfflinePages(); | 40 FetchOfflinePages(); |
41 } | 41 } |
42 | 42 |
43 ContentSuggestionsCategoryStatus | 43 ContentSuggestionsCategoryStatus |
44 OfflinePageSuggestionsProvider::GetCategoryStatus( | 44 OfflinePageSuggestionsProvider::GetCategoryStatus( |
45 ContentSuggestionsCategory category) { | 45 ContentSuggestionsCategory category) { |
46 return category_status_; | 46 return category_status_; |
47 } | 47 } |
48 | 48 |
49 void OfflinePageSuggestionsProvider::DiscardSuggestion( | 49 void OfflinePageSuggestionsProvider::DismissSuggestion( |
50 const std::string& suggestion_id) { | 50 const std::string& suggestion_id) { |
51 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, | 51 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, |
52 // then also implement ClearDiscardedSuggestionsForDebugging. | 52 // then also implement ClearDismissedSuggestionsForDebugging. |
53 } | 53 } |
54 | 54 |
55 void OfflinePageSuggestionsProvider::FetchSuggestionImage( | 55 void OfflinePageSuggestionsProvider::FetchSuggestionImage( |
56 const std::string& suggestion_id, | 56 const std::string& suggestion_id, |
57 const ImageFetchedCallback& callback) { | 57 const ImageFetchedCallback& callback) { |
58 // TODO(pke): Implement. | 58 // TODO(pke): Implement. |
59 } | 59 } |
60 | 60 |
61 void OfflinePageSuggestionsProvider::ClearCachedSuggestionsForDebugging() { | 61 void OfflinePageSuggestionsProvider::ClearCachedSuggestionsForDebugging() { |
62 // Ignored. | 62 // Ignored. |
63 } | 63 } |
64 | 64 |
65 void OfflinePageSuggestionsProvider::ClearDiscardedSuggestionsForDebugging() { | 65 void OfflinePageSuggestionsProvider::ClearDismissedSuggestionsForDebugging() { |
66 // TODO(pke): Implement when discarded suggestions are supported. | 66 // TODO(pke): Implement when dismissed suggestions are supported. |
67 } | 67 } |
68 | 68 |
69 void OfflinePageSuggestionsProvider::OfflinePageModelLoaded( | 69 void OfflinePageSuggestionsProvider::OfflinePageModelLoaded( |
70 OfflinePageModel* model) { | 70 OfflinePageModel* model) { |
71 DCHECK_EQ(offline_page_model_, model); | 71 DCHECK_EQ(offline_page_model_, model); |
72 } | 72 } |
73 | 73 |
74 void OfflinePageSuggestionsProvider::OfflinePageModelChanged( | 74 void OfflinePageSuggestionsProvider::OfflinePageModelChanged( |
75 OfflinePageModel* model) { | 75 OfflinePageModel* model) { |
76 DCHECK_EQ(offline_page_model_, model); | 76 DCHECK_EQ(offline_page_model_, model); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return; | 122 return; |
123 category_status_ = new_status; | 123 category_status_ = new_status; |
124 | 124 |
125 if (!observer_) | 125 if (!observer_) |
126 return; | 126 return; |
127 observer_->OnCategoryStatusChanged(ContentSuggestionsCategory::OFFLINE_PAGES, | 127 observer_->OnCategoryStatusChanged(ContentSuggestionsCategory::OFFLINE_PAGES, |
128 new_status); | 128 new_status); |
129 } | 129 } |
130 | 130 |
131 } // namespace ntp_snippets | 131 } // namespace ntp_snippets |
OLD | NEW |