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 <map> | 10 #include <map> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // Fetches snippets from the server and replaces old snippets by the new ones. | 94 // Fetches snippets from the server and replaces old snippets by the new ones. |
95 // Requests can be marked more important by setting |interactive_request| to | 95 // Requests can be marked more important by setting |interactive_request| to |
96 // true (such request might circumvent the daily quota for requests, etc.) | 96 // true (such request might circumvent the daily quota for requests, etc.) |
97 // Useful for requests triggered by the user. | 97 // Useful for requests triggered by the user. |
98 void FetchSnippets(bool interactive_request); | 98 void FetchSnippets(bool interactive_request); |
99 | 99 |
100 // Fetches snippets from the server for specified hosts (overriding | 100 // Fetches snippets from the server for specified hosts (overriding |
101 // suggestions from the suggestion service) and adds them to the current ones. | 101 // suggestions from the suggestion service) and adds them to the current ones. |
102 // Only called from chrome://snippets-internals, DO NOT USE otherwise! | 102 // Only called from chrome://snippets-internals, DO NOT USE otherwise! |
103 // Ignored while |loaded()| is false. | 103 // Ignored while ready() is false. |
104 void FetchSnippetsFromHosts(const std::set<std::string>& hosts, | 104 void FetchSnippetsFromHosts(const std::set<std::string>& hosts, |
105 bool interactive_request); | 105 bool interactive_request); |
106 | 106 |
107 const NTPSnippetsFetcher* snippets_fetcher() const { | 107 const NTPSnippetsFetcher* snippets_fetcher() const { |
108 return snippets_fetcher_.get(); | 108 return snippets_fetcher_.get(); |
109 } | 109 } |
110 | 110 |
111 // (Re)schedules the periodic fetching of snippets. | 111 // (Re)schedules the periodic fetching of snippets. |
112 void RescheduleFetching(); | 112 void RescheduleFetching(); |
113 | 113 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 359 |
360 // Request throttler for limiting requests to thumbnail images. | 360 // Request throttler for limiting requests to thumbnail images. |
361 RequestThrottler thumbnail_requests_throttler_; | 361 RequestThrottler thumbnail_requests_throttler_; |
362 | 362 |
363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
364 }; | 364 }; |
365 | 365 |
366 } // namespace ntp_snippets | 366 } // namespace ntp_snippets |
367 | 367 |
368 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 368 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
OLD | NEW |