| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // the schedule depends on the time of day | 83 // the schedule depends on the time of day |
| 84 void RescheduleFetching(); | 84 void RescheduleFetching(); |
| 85 | 85 |
| 86 // Deletes all currently stored snippets. | 86 // Deletes all currently stored snippets. |
| 87 void ClearSnippets(); | 87 void ClearSnippets(); |
| 88 | 88 |
| 89 // Discards the snippet with the given |url|, if it exists. Returns true iff | 89 // Discards the snippet with the given |url|, if it exists. Returns true iff |
| 90 // a snippet was discarded. | 90 // a snippet was discarded. |
| 91 bool DiscardSnippet(const GURL& url); | 91 bool DiscardSnippet(const GURL& url); |
| 92 | 92 |
| 93 // Returns the lists of snippets previously discarded by the user (that are | 93 // Returns the list of snippets previously discarded by the user (that are |
| 94 // not expired yet). | 94 // not expired yet). |
| 95 const NTPSnippetStorage& discarded_snippets() const { | 95 const NTPSnippetStorage& discarded_snippets() const { |
| 96 return discarded_snippets_; | 96 return discarded_snippets_; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // Clears the lists of snippets previously discarded by the user. | 99 // Clears the lists of snippets previously discarded by the user. |
| 100 void ClearDiscardedSnippets(); | 100 void ClearDiscardedSnippets(); |
| 101 | 101 |
| 102 // Returns the lists of suggestion hosts the snippets are restricted to. | 102 // Returns the lists of suggestion hosts the snippets are restricted to. |
| 103 std::set<std::string> GetSuggestionsHosts() const; | 103 std::set<std::string> GetSuggestionsHosts() const; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // Sent when the service is shutting down. | 206 // Sent when the service is shutting down. |
| 207 virtual void NTPSnippetsServiceShutdown() = 0; | 207 virtual void NTPSnippetsServiceShutdown() = 0; |
| 208 | 208 |
| 209 protected: | 209 protected: |
| 210 virtual ~NTPSnippetsServiceObserver() {} | 210 virtual ~NTPSnippetsServiceObserver() {} |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 } // namespace ntp_snippets | 213 } // namespace ntp_snippets |
| 214 | 214 |
| 215 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 215 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |