| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus( | 63 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus( |
| 64 Category category) { | 64 Category category) { |
| 65 return category_status_; | 65 return category_status_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( | 68 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( |
| 69 Category category) { | 69 Category category) { |
| 70 // TODO(vitaliii): Use a proper string once it's been agreed on. | 70 // TODO(vitaliii): Use a proper string once it's been agreed on. |
| 71 return CategoryInfo(base::ASCIIToUTF16("Physical web pages"), | 71 return CategoryInfo(base::ASCIIToUTF16("Physical web pages"), |
| 72 ContentSuggestionsCardLayout::MINIMAL_CARD, | 72 ContentSuggestionsCardLayout::MINIMAL_CARD, |
| 73 /* has_more_button */ true); | 73 /* has_more_button */ true, |
| 74 /* show_if_empty */ false); |
| 74 } | 75 } |
| 75 | 76 |
| 76 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( | 77 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( |
| 77 const std::string& suggestion_id) { | 78 const std::string& suggestion_id) { |
| 78 // TODO(vitaliii): Implement this and then | 79 // TODO(vitaliii): Implement this and then |
| 79 // ClearDismissedSuggestionsForDebugging. | 80 // ClearDismissedSuggestionsForDebugging. |
| 80 } | 81 } |
| 81 | 82 |
| 82 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( | 83 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( |
| 83 const std::string& suggestion_id, const ImageFetchedCallback& callback) { | 84 const std::string& suggestion_id, const ImageFetchedCallback& callback) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 106 | 107 |
| 107 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 108 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 108 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( | 109 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( |
| 109 CategoryStatus new_status) { | 110 CategoryStatus new_status) { |
| 110 if (category_status_ == new_status) return; | 111 if (category_status_ == new_status) return; |
| 111 category_status_ = new_status; | 112 category_status_ = new_status; |
| 112 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 113 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 113 } | 114 } |
| 114 | 115 |
| 115 } // namespace ntp_snippets | 116 } // namespace ntp_snippets |
| OLD | NEW |