| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |