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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( | 86 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( |
87 Category category) { | 87 Category category) { |
88 DCHECK_EQ(category, provided_category_); | 88 DCHECK_EQ(category, provided_category_); |
89 return category_status_; | 89 return category_status_; |
90 } | 90 } |
91 | 91 |
92 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { | 92 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { |
93 return CategoryInfo( | 93 return CategoryInfo( |
94 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), | 94 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), |
95 ContentSuggestionsCardLayout::MINIMAL_CARD); | 95 ContentSuggestionsCardLayout::MINIMAL_CARD, /* has_more_button */ true); |
96 } | 96 } |
97 | 97 |
98 void BookmarkSuggestionsProvider::DismissSuggestion( | 98 void BookmarkSuggestionsProvider::DismissSuggestion( |
99 const std::string& suggestion_id) { | 99 const std::string& suggestion_id) { |
100 DCHECK(bookmark_model_->loaded()); | 100 DCHECK(bookmark_model_->loaded()); |
101 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); | 101 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); |
102 MarkBookmarksDismissed(bookmark_model_, url); | 102 MarkBookmarksDismissed(bookmark_model_, url); |
103 } | 103 } |
104 | 104 |
105 void BookmarkSuggestionsProvider::FetchSuggestionImage( | 105 void BookmarkSuggestionsProvider::FetchSuggestionImage( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 226 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
227 CategoryStatus new_status) { | 227 CategoryStatus new_status) { |
228 if (category_status_ == new_status) | 228 if (category_status_ == new_status) |
229 return; | 229 return; |
230 category_status_ = new_status; | 230 category_status_ = new_status; |
231 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 231 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
232 } | 232 } |
233 | 233 |
234 } // namespace ntp_snippets | 234 } // namespace ntp_snippets |
OLD | NEW |