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

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

Issue 2207493002: Add CategoryInfo for meta information of content suggestions Categories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary include 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/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 std::vector<Category> OfflinePageSuggestionsProvider::GetProvidedCategories() { 43 std::vector<Category> OfflinePageSuggestionsProvider::GetProvidedCategories() {
44 return std::vector<Category>({provided_category_}); 44 return std::vector<Category>({provided_category_});
45 } 45 }
46 46
47 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus( 47 CategoryStatus OfflinePageSuggestionsProvider::GetCategoryStatus(
48 Category category) { 48 Category category) {
49 return category_status_; 49 return category_status_;
50 } 50 }
51 51
52 CategoryInfo OfflinePageSuggestionsProvider::GetCategoryInfo(
53 Category category) {
54 // TODO(pke): Use the proper string once it's agreed on.
55 return CategoryInfo(base::ASCIIToUTF16("Offline pages"));
56 }
57
52 void OfflinePageSuggestionsProvider::DismissSuggestion( 58 void OfflinePageSuggestionsProvider::DismissSuggestion(
53 const std::string& suggestion_id) { 59 const std::string& suggestion_id) {
54 // TODO(pke): Implement some "dont show on NTP anymore" behaviour, 60 // TODO(pke): Implement some "dont show on NTP anymore" behaviour,
55 // then also implement ClearDismissedSuggestionsForDebugging. 61 // then also implement ClearDismissedSuggestionsForDebugging.
56 } 62 }
57 63
58 void OfflinePageSuggestionsProvider::FetchSuggestionImage( 64 void OfflinePageSuggestionsProvider::FetchSuggestionImage(
59 const std::string& suggestion_id, 65 const std::string& suggestion_id,
60 const ImageFetchedCallback& callback) { 66 const ImageFetchedCallback& callback) {
61 // TODO(pke): Implement. 67 // TODO(pke): Implement.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void OfflinePageSuggestionsProvider::NotifyStatusChanged( 130 void OfflinePageSuggestionsProvider::NotifyStatusChanged(
125 CategoryStatus new_status) { 131 CategoryStatus new_status) {
126 if (category_status_ == new_status) 132 if (category_status_ == new_status)
127 return; 133 return;
128 category_status_ = new_status; 134 category_status_ = new_status;
129 135
130 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 136 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
131 } 137 }
132 138
133 } // namespace ntp_snippets 139 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698