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, /* has_more_button */ true); | 95 ContentSuggestionsCardLayout::MINIMAL_CARD, |
96 /* has_more_button = */ true, | |
Bernhard Bauer
2016/08/17 20:38:03
Nit: I think the more common style is to leave the
dgn
2016/08/18 09:52:57
Done.
| |
97 /* show_if_empty = */ false); | |
96 } | 98 } |
97 | 99 |
98 void BookmarkSuggestionsProvider::DismissSuggestion( | 100 void BookmarkSuggestionsProvider::DismissSuggestion( |
99 const std::string& suggestion_id) { | 101 const std::string& suggestion_id) { |
100 DCHECK(bookmark_model_->loaded()); | 102 DCHECK(bookmark_model_->loaded()); |
101 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); | 103 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); |
102 MarkBookmarksDismissed(bookmark_model_, url); | 104 MarkBookmarksDismissed(bookmark_model_, url); |
103 } | 105 } |
104 | 106 |
105 void BookmarkSuggestionsProvider::FetchSuggestionImage( | 107 void BookmarkSuggestionsProvider::FetchSuggestionImage( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 | 227 |
226 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 228 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
227 CategoryStatus new_status) { | 229 CategoryStatus new_status) { |
228 if (category_status_ == new_status) | 230 if (category_status_ == new_status) |
229 return; | 231 return; |
230 category_status_ = new_status; | 232 category_status_ = new_status; |
231 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 233 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
232 } | 234 } |
233 | 235 |
234 } // namespace ntp_snippets | 236 } // namespace ntp_snippets |
OLD | NEW |