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

Side by Side Diff: chrome/browser/ntp_snippets/download_suggestions_provider.cc

Issue 2663313002: 📰 Merge the has_fetch_more and has_reload actions (Closed)
Patch Set: rebase Created 3 years, 10 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 "chrome/browser/ntp_snippets/download_suggestions_provider.h" 5 #include "chrome/browser/ntp_snippets/download_suggestions_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 Category category) { 181 Category category) {
182 DCHECK_EQ(provided_category_, category); 182 DCHECK_EQ(provided_category_, category);
183 return category_status_; 183 return category_status_;
184 } 184 }
185 185
186 CategoryInfo DownloadSuggestionsProvider::GetCategoryInfo(Category category) { 186 CategoryInfo DownloadSuggestionsProvider::GetCategoryInfo(Category category) {
187 DCHECK_EQ(provided_category_, category); 187 DCHECK_EQ(provided_category_, category);
188 return CategoryInfo( 188 return CategoryInfo(
189 l10n_util::GetStringUTF16(IDS_NTP_DOWNLOAD_SUGGESTIONS_SECTION_HEADER), 189 l10n_util::GetStringUTF16(IDS_NTP_DOWNLOAD_SUGGESTIONS_SECTION_HEADER),
190 ntp_snippets::ContentSuggestionsCardLayout::MINIMAL_CARD, 190 ntp_snippets::ContentSuggestionsCardLayout::MINIMAL_CARD,
191 /*has_more_action=*/false, 191 /*has_fetch_action=*/false,
192 /*has_reload_action=*/false,
193 /*has_view_all_action=*/true, 192 /*has_view_all_action=*/true,
194 /*show_if_empty=*/false, 193 /*show_if_empty=*/false,
195 l10n_util::GetStringUTF16(IDS_NTP_DOWNLOADS_SUGGESTIONS_SECTION_EMPTY)); 194 l10n_util::GetStringUTF16(IDS_NTP_DOWNLOADS_SUGGESTIONS_SECTION_EMPTY));
196 } 195 }
197 196
198 void DownloadSuggestionsProvider::DismissSuggestion( 197 void DownloadSuggestionsProvider::DismissSuggestion(
199 const ContentSuggestion::ID& suggestion_id) { 198 const ContentSuggestion::ID& suggestion_id) {
200 DCHECK_EQ(provided_category_, suggestion_id.category()); 199 DCHECK_EQ(provided_category_, suggestion_id.category());
201 std::set<std::string> dismissed_ids = 200 std::set<std::string> dismissed_ids =
202 ReadDismissedIDsFromPrefs(CorrespondsToOfflinePage(suggestion_id)); 201 ReadDismissedIDsFromPrefs(CorrespondsToOfflinePage(suggestion_id));
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 void DownloadSuggestionsProvider::UnregisterDownloadItemObservers() { 809 void DownloadSuggestionsProvider::UnregisterDownloadItemObservers() {
811 DCHECK_NE(download_manager_, nullptr); 810 DCHECK_NE(download_manager_, nullptr);
812 811
813 std::vector<DownloadItem*> all_downloads; 812 std::vector<DownloadItem*> all_downloads;
814 download_manager_->GetAllDownloads(&all_downloads); 813 download_manager_->GetAllDownloads(&all_downloads);
815 814
816 for (DownloadItem* item : all_downloads) { 815 for (DownloadItem* item : all_downloads) {
817 item->RemoveObserver(this); 816 item->RemoveObserver(this);
818 } 817 }
819 } 818 }
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.cc ('k') | components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698