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

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

Issue 2363753002: [NTP Snippets] Don't reschedule background fetching on every startup (Closed)
Patch Set: rebase Created 4 years, 2 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 <map> 10 #include <map>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ready() 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. If |force| is true, the
112 void RescheduleFetching(); 112 // tasks will be re-scheduled even if they already exist and have the correct
113 // periods.
114 void RescheduleFetching(bool force);
113 115
114 // ContentSuggestionsProvider implementation 116 // ContentSuggestionsProvider implementation
115 CategoryStatus GetCategoryStatus(Category category) override; 117 CategoryStatus GetCategoryStatus(Category category) override;
116 CategoryInfo GetCategoryInfo(Category category) override; 118 CategoryInfo GetCategoryInfo(Category category) override;
117 void DismissSuggestion(const std::string& suggestion_id) override; 119 void DismissSuggestion(const std::string& suggestion_id) override;
118 void FetchSuggestionImage(const std::string& suggestion_id, 120 void FetchSuggestionImage(const std::string& suggestion_id,
119 const ImageFetchedCallback& callback) override; 121 const ImageFetchedCallback& callback) override;
120 void ClearHistory( 122 void ClearHistory(
121 base::Time begin, 123 base::Time begin,
122 base::Time end, 124 base::Time end,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 361
360 // Request throttler for limiting requests to thumbnail images. 362 // Request throttler for limiting requests to thumbnail images.
361 RequestThrottler thumbnail_requests_throttler_; 363 RequestThrottler thumbnail_requests_throttler_;
362 364
363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); 365 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService);
364 }; 366 };
365 367
366 } // namespace ntp_snippets 368 } // namespace ntp_snippets
367 369
368 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 370 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698