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

Side by Side Diff: components/ntp_snippets/ntp_snippets_service.h

Issue 1978513002: Getting the personalization info in chrome://snippets-internals correct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After code review #2 Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // Available snippets. 79 // Available snippets.
80 const NTPSnippet::PtrVector& snippets() const { return snippets_; } 80 const NTPSnippet::PtrVector& snippets() const { return snippets_; }
81 81
82 // Returns the list of snippets previously discarded by the user (that are 82 // Returns the list of snippets previously discarded by the user (that are
83 // not expired yet). 83 // not expired yet).
84 const NTPSnippet::PtrVector& discarded_snippets() const { 84 const NTPSnippet::PtrVector& discarded_snippets() const {
85 return discarded_snippets_; 85 return discarded_snippets_;
86 } 86 }
87 87
88 // Returns the last status message from the snippets fetcher. 88 const NTPSnippetsFetcher* snippets_fetcher() const {
89 const std::string& last_status() const { 89 return snippets_fetcher_.get();
90 return snippets_fetcher_->last_status();
91 }
92
93 // Returns the last json from the snippets fetcher.
94 const std::string& last_json() const {
95 return snippets_fetcher_->last_json();
96 } 90 }
97 91
98 // (Re)schedules the periodic fetching of snippets. This is necessary because 92 // (Re)schedules the periodic fetching of snippets. This is necessary because
99 // the schedule depends on the time of day. 93 // the schedule depends on the time of day.
100 void RescheduleFetching(); 94 void RescheduleFetching();
101 95
102 // Fetches the image for the snippet with the given |snippet_id| and runs the 96 // Fetches the image for the snippet with the given |snippet_id| and runs the
103 // |callback|. If that snippet doesn't exist or the fetch fails, the callback 97 // |callback|. If that snippet doesn't exist or the fetch fails, the callback
104 // gets a null image. 98 // gets a null image.
105 void FetchSnippetImage(const std::string& snippet_id, 99 void FetchSnippetImage(const std::string& snippet_id,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // hosts. (e.g. the user manually removed all MostLikely tiles.) 198 // hosts. (e.g. the user manually removed all MostLikely tiles.)
205 virtual void NTPSnippetsServiceCleared() = 0; 199 virtual void NTPSnippetsServiceCleared() = 0;
206 200
207 protected: 201 protected:
208 virtual ~NTPSnippetsServiceObserver() {} 202 virtual ~NTPSnippetsServiceObserver() {}
209 }; 203 };
210 204
211 } // namespace ntp_snippets 205 } // namespace ntp_snippets
212 206
213 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 207 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
OLDNEW
« no previous file with comments | « components/ntp_snippets/ntp_snippets_fetcher.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698