| 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/physical_web_pages/physical_web_page_suggestio
ns_provider.h" | 5 #include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestio
ns_provider.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/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 | 85 |
| 86 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( | 86 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( |
| 87 const ContentSuggestion::ID& suggestion_id, | 87 const ContentSuggestion::ID& suggestion_id, |
| 88 const ImageFetchedCallback& callback) { | 88 const ImageFetchedCallback& callback) { |
| 89 // TODO(vitaliii): Implement. | 89 // TODO(vitaliii): Implement. |
| 90 base::ThreadTaskRunnerHandle::Get()->PostTask( | 90 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 91 FROM_HERE, base::Bind(callback, gfx::Image())); | 91 FROM_HERE, base::Bind(callback, gfx::Image())); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void PhysicalWebPageSuggestionsProvider::FetchMore( | 94 void PhysicalWebPageSuggestionsProvider::Fetch( |
| 95 const Category& category, | 95 const Category& category, |
| 96 FetchedMoreCallback callback) { | 96 std::set<std::string> known_suggestion_ids, |
| 97 // Ignored. | 97 FetchingCallback callback) { |
| 98 NOTREACHED(); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void PhysicalWebPageSuggestionsProvider::ClearHistory( | 101 void PhysicalWebPageSuggestionsProvider::ClearHistory( |
| 101 base::Time begin, | 102 base::Time begin, |
| 102 base::Time end, | 103 base::Time end, |
| 103 const base::Callback<bool(const GURL& url)>& filter) { | 104 const base::Callback<bool(const GURL& url)>& filter) { |
| 104 ClearDismissedSuggestionsForDebugging(provided_category_); | 105 ClearDismissedSuggestionsForDebugging(provided_category_); |
| 105 } | 106 } |
| 106 | 107 |
| 107 void PhysicalWebPageSuggestionsProvider::ClearCachedSuggestions( | 108 void PhysicalWebPageSuggestionsProvider::ClearCachedSuggestions( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 126 | 127 |
| 127 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 128 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 128 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( | 129 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( |
| 129 CategoryStatus new_status) { | 130 CategoryStatus new_status) { |
| 130 if (category_status_ == new_status) return; | 131 if (category_status_ == new_status) return; |
| 131 category_status_ = new_status; | 132 category_status_ = new_status; |
| 132 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 133 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 133 } | 134 } |
| 134 | 135 |
| 135 } // namespace ntp_snippets | 136 } // namespace ntp_snippets |
| OLD | NEW |