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

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

Issue 1908973002: [NTP Snippets] Add newly-fetched snippets at the front instead of at the end (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: spaces! Created 4 years, 8 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 | « no previous file | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 10 #include <set>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // TODO(treib): Investigate a better storage, maybe LevelDB or SQLite? 141 // TODO(treib): Investigate a better storage, maybe LevelDB or SQLite?
142 void LoadSnippetsFromPrefs(); 142 void LoadSnippetsFromPrefs();
143 void StoreSnippetsToPrefs(); 143 void StoreSnippetsToPrefs();
144 144
145 void LoadDiscardedSnippetsFromPrefs(); 145 void LoadDiscardedSnippetsFromPrefs();
146 void StoreDiscardedSnippetsToPrefs(); 146 void StoreDiscardedSnippetsToPrefs();
147 147
148 std::set<std::string> GetSnippetHostsFromPrefs() const; 148 std::set<std::string> GetSnippetHostsFromPrefs() const;
149 void StoreSnippetHostsToPrefs(const std::set<std::string>& hosts); 149 void StoreSnippetHostsToPrefs(const std::set<std::string>& hosts);
150 150
151 bool HasDiscardedSnippet(const GURL& url) const;
152
153 void RemoveExpiredSnippets(); 151 void RemoveExpiredSnippets();
154 152
155 bool enabled_; 153 bool enabled_;
156 154
157 PrefService* pref_service_; 155 PrefService* pref_service_;
158 156
159 suggestions::SuggestionsService* suggestions_service_; 157 suggestions::SuggestionsService* suggestions_service_;
160 158
161 // The SequencedTaskRunner on which file system operations will be run. 159 // The SequencedTaskRunner on which file system operations will be run.
162 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; 160 scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // Sent when the service is shutting down. 206 // Sent when the service is shutting down.
209 virtual void NTPSnippetsServiceShutdown() = 0; 207 virtual void NTPSnippetsServiceShutdown() = 0;
210 208
211 protected: 209 protected:
212 virtual ~NTPSnippetsServiceObserver() {} 210 virtual ~NTPSnippetsServiceObserver() {}
213 }; 211 };
214 212
215 } // namespace ntp_snippets 213 } // namespace ntp_snippets
216 214
217 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 215 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698