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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( | 103 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( |
104 Category category) { | 104 Category category) { |
105 DCHECK_EQ(category, provided_category_); | 105 DCHECK_EQ(category, provided_category_); |
106 return category_status_; | 106 return category_status_; |
107 } | 107 } |
108 | 108 |
109 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { | 109 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { |
110 return CategoryInfo( | 110 return CategoryInfo( |
111 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), | 111 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), |
112 ContentSuggestionsCardLayout::MINIMAL_CARD, | 112 ContentSuggestionsCardLayout::MINIMAL_CARD, |
113 /*has_fetch_action=*/false, | 113 ContentSuggestionsAdditionalAction::VIEW_ALL, |
114 /*has_view_all_action=*/true, | |
115 /*show_if_empty=*/false, | 114 /*show_if_empty=*/false, |
116 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY)); | 115 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY)); |
117 } | 116 } |
118 | 117 |
119 void BookmarkSuggestionsProvider::DismissSuggestion( | 118 void BookmarkSuggestionsProvider::DismissSuggestion( |
120 const ContentSuggestion::ID& suggestion_id) { | 119 const ContentSuggestion::ID& suggestion_id) { |
121 DCHECK(bookmark_model_->loaded()); | 120 DCHECK(bookmark_model_->loaded()); |
122 GURL url(suggestion_id.id_within_category()); | 121 GURL url(suggestion_id.id_within_category()); |
123 MarkBookmarksDismissed(bookmark_model_, url); | 122 MarkBookmarksDismissed(bookmark_model_, url); |
124 } | 123 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 318 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
320 CategoryStatus new_status) { | 319 CategoryStatus new_status) { |
321 if (category_status_ == new_status) { | 320 if (category_status_ == new_status) { |
322 return; | 321 return; |
323 } | 322 } |
324 category_status_ = new_status; | 323 category_status_ = new_status; |
325 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 324 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
326 } | 325 } |
327 | 326 |
328 } // namespace ntp_snippets | 327 } // namespace ntp_snippets |
OLD | NEW |