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

Side by Side Diff: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc

Issue 2232783002: Support action button to fetch more content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippetsbridge
Patch Set: Refactor NewTabPageAdapterTest 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/offline_pages/offline_page_suggestions_provide r.h" 5 #include "components/ntp_snippets/offline_pages/offline_page_suggestions_provide r.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus( 50 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus(
51 Category category) { 51 Category category) {
52 DCHECK_EQ(category, provided_category_); 52 DCHECK_EQ(category, provided_category_);
53 return category_status_; 53 return category_status_;
54 } 54 }
55 55
56 CategoryInfo OfflinePageSuggestionsProvider::GetCategoryInfo( 56 CategoryInfo OfflinePageSuggestionsProvider::GetCategoryInfo(
57 Category category) { 57 Category category) {
58 // TODO(pke): Use the proper string once it's agreed on. 58 // TODO(pke): Use the proper string once it's agreed on.
59 return CategoryInfo(base::ASCIIToUTF16("Offline pages"), 59 return CategoryInfo(base::ASCIIToUTF16("Offline pages"),
60 ContentSuggestionsCardLayout::MINIMAL_CARD); 60 ContentSuggestionsCardLayout::MINIMAL_CARD, false);
Marc Treib 2016/08/12 08:44:39 and here
Philipp Keck 2016/08/12 09:11:32 Done.
61 } 61 }
62 62
63 void OfflinePageSuggestionsProvider::DismissSuggestion( 63 void OfflinePageSuggestionsProvider::DismissSuggestion(
64 const std::string& suggestion_id) { 64 const std::string& suggestion_id) {
65 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, 65 // TODO(pke): Implement some "dont show on NTP anymore" behaviour,
66 // then also implement ClearDismissedSuggestionsForDebugging. 66 // then also implement ClearDismissedSuggestionsForDebugging.
67 } 67 }
68 68
69 void OfflinePageSuggestionsProvider::FetchSuggestionImage( 69 void OfflinePageSuggestionsProvider::FetchSuggestionImage(
70 const std::string& suggestion_id, 70 const std::string& suggestion_id,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void OfflinePageSuggestionsProvider::NotifyStatusChanged( 150 void OfflinePageSuggestionsProvider::NotifyStatusChanged(
151 CategoryStatus new_status) { 151 CategoryStatus new_status) {
152 if (category_status_ == new_status) 152 if (category_status_ == new_status)
153 return; 153 return;
154 category_status_ = new_status; 154 category_status_ = new_status;
155 155
156 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 156 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
157 } 157 }
158 158
159 } // namespace ntp_snippets 159 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698