| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 Category category) { | 65 Category category) { |
| 66 return category_status_; | 66 return category_status_; |
| 67 } | 67 } |
| 68 | 68 |
| 69 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( | 69 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( |
| 70 Category category) { | 70 Category category) { |
| 71 // TODO(vitaliii): Use the proper strings once they've been agreed on. | 71 // TODO(vitaliii): Use the proper strings once they've been agreed on. |
| 72 return CategoryInfo( | 72 return CategoryInfo( |
| 73 base::ASCIIToUTF16("Physical web pages"), | 73 base::ASCIIToUTF16("Physical web pages"), |
| 74 ContentSuggestionsCardLayout::MINIMAL_CARD, | 74 ContentSuggestionsCardLayout::MINIMAL_CARD, |
| 75 /* has_more_button */ true, | 75 /*has_more_action=*/false, |
| 76 /* show_if_empty */ false, | 76 /*has_reload_action=*/false, |
| 77 /*has_view_all_action=*/false, |
| 78 /*show_if_empty=*/false, |
| 77 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); | 79 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); |
| 78 } | 80 } |
| 79 | 81 |
| 80 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( | 82 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( |
| 81 const ContentSuggestion::ID& suggestion_id) { | 83 const ContentSuggestion::ID& suggestion_id) { |
| 82 // TODO(vitaliii): Implement this and then | 84 // TODO(vitaliii): Implement this and then |
| 83 // ClearDismissedSuggestionsForDebugging. | 85 // ClearDismissedSuggestionsForDebugging. |
| 84 } | 86 } |
| 85 | 87 |
| 86 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( | 88 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 122 |
| 121 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 123 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 122 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( | 124 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( |
| 123 CategoryStatus new_status) { | 125 CategoryStatus new_status) { |
| 124 if (category_status_ == new_status) return; | 126 if (category_status_ == new_status) return; |
| 125 category_status_ = new_status; | 127 category_status_ = new_status; |
| 126 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 128 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 127 } | 129 } |
| 128 | 130 |
| 129 } // namespace ntp_snippets | 131 } // namespace ntp_snippets |
| OLD | NEW |