| 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_more_action=*/false, | 113 /*has_fetch_action=*/false, |
| 114 /*has_reload_action=*/false, | |
| 115 /*has_view_all_action=*/true, | 114 /*has_view_all_action=*/true, |
| 116 /*show_if_empty=*/false, | 115 /*show_if_empty=*/false, |
| 117 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY)); | 116 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY)); |
| 118 } | 117 } |
| 119 | 118 |
| 120 void BookmarkSuggestionsProvider::DismissSuggestion( | 119 void BookmarkSuggestionsProvider::DismissSuggestion( |
| 121 const ContentSuggestion::ID& suggestion_id) { | 120 const ContentSuggestion::ID& suggestion_id) { |
| 122 DCHECK(bookmark_model_->loaded()); | 121 DCHECK(bookmark_model_->loaded()); |
| 123 GURL url(suggestion_id.id_within_category()); | 122 GURL url(suggestion_id.id_within_category()); |
| 124 MarkBookmarksDismissed(bookmark_model_, url); | 123 MarkBookmarksDismissed(bookmark_model_, url); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 319 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
| 321 CategoryStatus new_status) { | 320 CategoryStatus new_status) { |
| 322 if (category_status_ == new_status) { | 321 if (category_status_ == new_status) { |
| 323 return; | 322 return; |
| 324 } | 323 } |
| 325 category_status_ = new_status; | 324 category_status_ = new_status; |
| 326 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 325 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 327 } | 326 } |
| 328 | 327 |
| 329 } // namespace ntp_snippets | 328 } // namespace ntp_snippets |
| OLD | NEW |