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

Side by Side Diff: components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.cc

Issue 2260783002: Make GetDismissedSuggestionsForDebugging asynchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace function pointer, use multiple if-continue 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
« no previous file with comments | « components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage( 82 void PhysicalWebPageSuggestionsProvider::FetchSuggestionImage(
83 const std::string& suggestion_id, const ImageFetchedCallback& callback) { 83 const std::string& suggestion_id, const ImageFetchedCallback& callback) {
84 // TODO(vitaliii): Implement. 84 // TODO(vitaliii): Implement.
85 } 85 }
86 86
87 void PhysicalWebPageSuggestionsProvider::ClearCachedSuggestionsForDebugging( 87 void PhysicalWebPageSuggestionsProvider::ClearCachedSuggestionsForDebugging(
88 Category category) { 88 Category category) {
89 // Ignored 89 // Ignored
90 } 90 }
91 91
92 std::vector<ContentSuggestion> 92 void PhysicalWebPageSuggestionsProvider::GetDismissedSuggestionsForDebugging(
93 PhysicalWebPageSuggestionsProvider::GetDismissedSuggestionsForDebugging( 93 Category category,
94 Category category) { 94 const DismissedSuggestionsCallback& callback) {
95 // Not implemented. 95 // Not implemented.
96 return std::vector<ContentSuggestion>(); 96 callback.Run(std::vector<ContentSuggestion>());
97 } 97 }
98 98
99 void PhysicalWebPageSuggestionsProvider::ClearDismissedSuggestionsForDebugging( 99 void PhysicalWebPageSuggestionsProvider::ClearDismissedSuggestionsForDebugging(
100 Category category) { 100 Category category) {
101 // TODO(vitaliii): Implement when dismissed suggestions are supported. 101 // TODO(vitaliii): Implement when dismissed suggestions are supported.
102 } 102 }
103 103
104 //////////////////////////////////////////////////////////////////////////////// 104 ////////////////////////////////////////////////////////////////////////////////
105 // Private methods 105 // Private methods
106 106
107 // Updates the |category_status_| and notifies the |observer_|, if necessary. 107 // Updates the |category_status_| and notifies the |observer_|, if necessary.
108 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( 108 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged(
109 CategoryStatus new_status) { 109 CategoryStatus new_status) {
110 if (category_status_ == new_status) return; 110 if (category_status_ == new_status) return;
111 category_status_ = new_status; 111 category_status_ = new_status;
112 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 112 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
113 } 113 }
114 114
115 } // namespace ntp_snippets 115 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698