Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc

Issue 2447163004: [NTP Snippets] Pass "no suggestions" message from the backend to the UI (Closed)
Patch Set: fix comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_button=*/true,
138 /*show_if_empty=*/false); 138 /*show_if_empty=*/false,
139 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_EMPTY));
139 } 140 }
140 141
141 void BookmarkSuggestionsProvider::DismissSuggestion( 142 void BookmarkSuggestionsProvider::DismissSuggestion(
142 const ContentSuggestion::ID& suggestion_id) { 143 const ContentSuggestion::ID& suggestion_id) {
143 DCHECK(bookmark_model_->loaded()); 144 DCHECK(bookmark_model_->loaded());
144 GURL url(suggestion_id.id_within_category()); 145 GURL url(suggestion_id.id_within_category());
145 MarkBookmarksDismissed(bookmark_model_, url); 146 MarkBookmarksDismissed(bookmark_model_, url);
146 } 147 }
147 148
148 void BookmarkSuggestionsProvider::FetchSuggestionImage( 149 void BookmarkSuggestionsProvider::FetchSuggestionImage(
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 304
304 void BookmarkSuggestionsProvider::NotifyStatusChanged( 305 void BookmarkSuggestionsProvider::NotifyStatusChanged(
305 CategoryStatus new_status) { 306 CategoryStatus new_status) {
306 if (category_status_ == new_status) 307 if (category_status_ == new_status)
307 return; 308 return;
308 category_status_ = new_status; 309 category_status_ = new_status;
309 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 310 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
310 } 311 }
311 312
312 } // namespace ntp_snippets 313 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.cc ('k') | components/ntp_snippets/category_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698