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

Side by Side Diff: components/ntp_snippets/physical_web_pages/physical_web_page_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/physical_web_pages/physical_web_page_suggestio ns_provider.h" 5 #include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestio ns_provider.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/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus( 63 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus(
64 Category category) { 64 Category category) {
65 return category_status_; 65 return category_status_;
66 } 66 }
67 67
68 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( 68 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo(
69 Category category) { 69 Category category) {
70 // TODO(vitaliii): Use a proper string once it's been agreed on. 70 // TODO(vitaliii): Use a proper string once it's been agreed on.
71 return CategoryInfo(base::ASCIIToUTF16("Physical web pages"), 71 return CategoryInfo(base::ASCIIToUTF16("Physical web pages"),
72 ContentSuggestionsCardLayout::MINIMAL_CARD, 72 ContentSuggestionsCardLayout::MINIMAL_CARD,
73 /* has_more_button */ true); 73 /* has_more_button */ true,
74 /* show_if_empty */ false);
74 } 75 }
75 76
76 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( 77 void PhysicalWebPageSuggestionsProvider::DismissSuggestion(
77 const std::string& suggestion_id) { 78 const std::string& suggestion_id) {
78 // TODO(vitaliii): Implement this and then 79 // TODO(vitaliii): Implement this and then
79 // ClearDismissedSuggestionsForDebugging. 80 // ClearDismissedSuggestionsForDebugging.
80 } 81 }
81 82
82 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( 83 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage(
83 const std::string& suggestion_id, const ImageFetchedCallback& callback) { 84 const std::string& suggestion_id, const ImageFetchedCallback& callback) {
(...skipping 22 matching lines...) Expand all
106 107
107 // Updates the |category_status_| and notifies the |observer_|, if necessary. 108 // Updates the |category_status_| and notifies the |observer_|, if necessary.
108 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( 109 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged(
109 CategoryStatus new_status) { 110 CategoryStatus new_status) {
110 if (category_status_ == new_status) return; 111 if (category_status_ == new_status) return;
111 category_status_ = new_status; 112 category_status_ = new_status;
112 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 113 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
113 } 114 }
114 115
115 } // namespace ntp_snippets 116 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc ('k') | components/ntp_snippets_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698