| 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/bookmarks/bookmark_suggestions_provider.h" | 5 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( | 127 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( |
| 128 Category category) { | 128 Category category) { |
| 129 DCHECK_EQ(category, provided_category_); | 129 DCHECK_EQ(category, provided_category_); |
| 130 return category_status_; | 130 return category_status_; |
| 131 } | 131 } |
| 132 | 132 |
| 133 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { | 133 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { |
| 134 return CategoryInfo( | 134 return CategoryInfo( |
| 135 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), | 135 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), |
| 136 ContentSuggestionsCardLayout::MINIMAL_CARD, | 136 ContentSuggestionsCardLayout::MINIMAL_CARD, |
| 137 /*has_more_button=*/true, | 137 /*has_more_action=*/false, |
| 138 /*has_reload_action=*/false, |
| 139 /*has_view_all_action=*/true, |
| 138 /*show_if_empty=*/false, | 140 /*show_if_empty=*/false, |
| 139 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY)); | 141 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY)); |
| 140 } | 142 } |
| 141 | 143 |
| 142 void BookmarkSuggestionsProvider::DismissSuggestion( | 144 void BookmarkSuggestionsProvider::DismissSuggestion( |
| 143 const ContentSuggestion::ID& suggestion_id) { | 145 const ContentSuggestion::ID& suggestion_id) { |
| 144 DCHECK(bookmark_model_->loaded()); | 146 DCHECK(bookmark_model_->loaded()); |
| 145 GURL url(suggestion_id.id_within_category()); | 147 GURL url(suggestion_id.id_within_category()); |
| 146 MarkBookmarksDismissed(bookmark_model_, url); | 148 MarkBookmarksDismissed(bookmark_model_, url); |
| 147 } | 149 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 306 |
| 305 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 307 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
| 306 CategoryStatus new_status) { | 308 CategoryStatus new_status) { |
| 307 if (category_status_ == new_status) | 309 if (category_status_ == new_status) |
| 308 return; | 310 return; |
| 309 category_status_ = new_status; | 311 category_status_ = new_status; |
| 310 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 312 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 311 } | 313 } |
| 312 | 314 |
| 313 } // namespace ntp_snippets | 315 } // namespace ntp_snippets |
| OLD | NEW |