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

Side by Side Diff: components/suggestions/suggestions_service_impl.h

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter Created 3 years, 10 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 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 // Helpers to build the various suggestions URLs. These are static members 104 // Helpers to build the various suggestions URLs. These are static members
105 // rather than local functions in the .cc file to make them accessible to 105 // rather than local functions in the .cc file to make them accessible to
106 // tests. 106 // tests.
107 static GURL BuildSuggestionsURL(); 107 static GURL BuildSuggestionsURL();
108 static std::string BuildSuggestionsBlacklistURLPrefix(); 108 static std::string BuildSuggestionsBlacklistURLPrefix();
109 static GURL BuildSuggestionsBlacklistURL(const GURL& candidate_url); 109 static GURL BuildSuggestionsBlacklistURL(const GURL& candidate_url);
110 static GURL BuildSuggestionsBlacklistClearURL(); 110 static GURL BuildSuggestionsBlacklistClearURL();
111 111
112 // syncer::SyncServiceObserver implementation. 112 // syncer::SyncServiceObserver implementation.
113 void OnStateChanged() override; 113 void OnStateChanged(syncer::SyncService* sync) override;
114 114
115 // Sets default timestamp for suggestions which do not have expiry timestamp. 115 // Sets default timestamp for suggestions which do not have expiry timestamp.
116 void SetDefaultExpiryTimestamp(SuggestionsProfile* suggestions, 116 void SetDefaultExpiryTimestamp(SuggestionsProfile* suggestions,
117 int64_t timestamp_usec); 117 int64_t timestamp_usec);
118 118
119 // Issues a network request if there isn't already one happening. 119 // Issues a network request if there isn't already one happening.
120 void IssueRequestIfNoneOngoing(const GURL& url); 120 void IssueRequestIfNoneOngoing(const GURL& url);
121 121
122 // Issues a network request for suggestions (fetch, blacklist, or clear 122 // Issues a network request for suggestions (fetch, blacklist, or clear
123 // blacklist, depending on |url|). |access_token| is used only if OAuth2 123 // blacklist, depending on |url|). |access_token| is used only if OAuth2
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // For callbacks may be run after destruction. 195 // For callbacks may be run after destruction.
196 base::WeakPtrFactory<SuggestionsServiceImpl> weak_ptr_factory_; 196 base::WeakPtrFactory<SuggestionsServiceImpl> weak_ptr_factory_;
197 197
198 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceImpl); 198 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceImpl);
199 }; 199 };
200 200
201 } // namespace suggestions 201 } // namespace suggestions
202 202
203 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_ 203 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698