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

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

Issue 2249903003: 📰 Empty state handling for the Bookmarks section (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix instrumentation test Created 4 years, 4 months 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( 98 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus(
99 Category category) { 99 Category category) {
100 DCHECK_EQ(category, provided_category_); 100 DCHECK_EQ(category, provided_category_);
101 return category_status_; 101 return category_status_;
102 } 102 }
103 103
104 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { 104 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) {
105 return CategoryInfo( 105 return CategoryInfo(
106 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), 106 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER),
107 ContentSuggestionsCardLayout::MINIMAL_CARD, /* has_more_button */ true); 107 ContentSuggestionsCardLayout::MINIMAL_CARD,
108 /* has_more_button */ true,
109 /* show_if_empty */ false);
108 } 110 }
109 111
110 void BookmarkSuggestionsProvider::DismissSuggestion( 112 void BookmarkSuggestionsProvider::DismissSuggestion(
111 const std::string& suggestion_id) { 113 const std::string& suggestion_id) {
112 DCHECK(bookmark_model_->loaded()); 114 DCHECK(bookmark_model_->loaded());
113 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); 115 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id));
114 MarkBookmarksDismissed(bookmark_model_, url); 116 MarkBookmarksDismissed(bookmark_model_, url);
115 } 117 }
116 118
117 void BookmarkSuggestionsProvider::FetchSuggestionImage( 119 void BookmarkSuggestionsProvider::FetchSuggestionImage(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 240
239 void BookmarkSuggestionsProvider::NotifyStatusChanged( 241 void BookmarkSuggestionsProvider::NotifyStatusChanged(
240 CategoryStatus new_status) { 242 CategoryStatus new_status) {
241 if (category_status_ == new_status) 243 if (category_status_ == new_status)
242 return; 244 return;
243 category_status_ = new_status; 245 category_status_ = new_status;
244 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 246 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
245 } 247 }
246 248
247 } // namespace ntp_snippets 249 } // 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