OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ |
6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ | 6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 // Helpers to build the various suggestions URLs. These are static members | 106 // Helpers to build the various suggestions URLs. These are static members |
107 // rather than local functions in the .cc file to make them accessible to | 107 // rather than local functions in the .cc file to make them accessible to |
108 // tests. | 108 // tests. |
109 static GURL BuildSuggestionsURL(); | 109 static GURL BuildSuggestionsURL(); |
110 static std::string BuildSuggestionsBlacklistURLPrefix(); | 110 static std::string BuildSuggestionsBlacklistURLPrefix(); |
111 static GURL BuildSuggestionsBlacklistURL(const GURL& candidate_url); | 111 static GURL BuildSuggestionsBlacklistURL(const GURL& candidate_url); |
112 static GURL BuildSuggestionsBlacklistClearURL(); | 112 static GURL BuildSuggestionsBlacklistClearURL(); |
113 | 113 |
114 // syncer::SyncServiceObserver implementation. | 114 // syncer::SyncServiceObserver implementation. |
115 void OnStateChanged() override; | 115 void OnStateChanged(syncer::SyncService* sync) override; |
116 | 116 |
117 // Sets default timestamp for suggestions which do not have expiry timestamp. | 117 // Sets default timestamp for suggestions which do not have expiry timestamp. |
118 void SetDefaultExpiryTimestamp(SuggestionsProfile* suggestions, | 118 void SetDefaultExpiryTimestamp(SuggestionsProfile* suggestions, |
119 int64_t timestamp_usec); | 119 int64_t timestamp_usec); |
120 | 120 |
121 // Issues a network request if there isn't already one happening. | 121 // Issues a network request if there isn't already one happening. |
122 void IssueRequestIfNoneOngoing(const GURL& url); | 122 void IssueRequestIfNoneOngoing(const GURL& url); |
123 | 123 |
124 // Called when an access token request completes (successfully or not). | 124 // Called when an access token request completes (successfully or not). |
125 void AccessTokenAvailable(const GURL& url, | 125 void AccessTokenAvailable(const GURL& url, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 // For callbacks may be run after destruction. | 204 // For callbacks may be run after destruction. |
205 base::WeakPtrFactory<SuggestionsServiceImpl> weak_ptr_factory_; | 205 base::WeakPtrFactory<SuggestionsServiceImpl> weak_ptr_factory_; |
206 | 206 |
207 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceImpl); | 207 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceImpl); |
208 }; | 208 }; |
209 | 209 |
210 } // namespace suggestions | 210 } // namespace suggestions |
211 | 211 |
212 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ | 212 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ |
OLD | NEW |