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

Side by Side Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2249903003: 📰 Empty state handling for the Bookmarks section (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ntp_snippets_service.h" 5 #include "components/ntp_snippets/ntp_snippets_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 278
279 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { 279 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) {
280 DCHECK(category.IsKnownCategory(KnownCategories::ARTICLES)); 280 DCHECK(category.IsKnownCategory(KnownCategories::ARTICLES));
281 return category_status_; 281 return category_status_;
282 } 282 }
283 283
284 CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) { 284 CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) {
285 return CategoryInfo( 285 return CategoryInfo(
286 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER), 286 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER),
287 ContentSuggestionsCardLayout::FULL_CARD, /* has_more_button */ false); 287 ContentSuggestionsCardLayout::FULL_CARD,
288 /* has_more_button */ false,
289 /* show_if_empty = */ true);
Bernhard Bauer 2016/08/17 20:38:03 Here as well.
dgn 2016/08/18 09:52:57 Done.
288 } 290 }
289 291
290 void NTPSnippetsService::DismissSuggestion(const std::string& suggestion_id) { 292 void NTPSnippetsService::DismissSuggestion(const std::string& suggestion_id) {
291 if (!ready()) 293 if (!ready())
292 return; 294 return;
293 295
294 std::string snippet_id = GetWithinCategoryIDFromUniqueID(suggestion_id); 296 std::string snippet_id = GetWithinCategoryIDFromUniqueID(suggestion_id);
295 297
296 auto it = 298 auto it =
297 std::find_if(snippets_.begin(), snippets_.end(), 299 std::find_if(snippets_.begin(), snippets_.end(),
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 void NTPSnippetsService::UpdateCategoryStatus(CategoryStatus status) { 816 void NTPSnippetsService::UpdateCategoryStatus(CategoryStatus status) {
815 if (status == category_status_) 817 if (status == category_status_)
816 return; 818 return;
817 819
818 category_status_ = status; 820 category_status_ = status;
819 observer()->OnCategoryStatusChanged(this, provided_category_, 821 observer()->OnCategoryStatusChanged(this, provided_category_,
820 category_status_); 822 category_status_);
821 } 823 }
822 824
823 } // namespace ntp_snippets 825 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698