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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_provider.h

Issue 2786023002: [Remote suggestions] Remove the unique_ptr wrapper around callbacks (Closed)
Patch Set: Created 3 years, 8 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_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 14 matching lines...) Expand all
25 using FetchStatusCallback = base::Callback<void(Status status_code)>; 25 using FetchStatusCallback = base::Callback<void(Status status_code)>;
26 26
27 ~RemoteSuggestionsProvider() override; 27 ~RemoteSuggestionsProvider() override;
28 28
29 // Fetches suggestions from the server for all remote categories and replaces 29 // Fetches suggestions from the server for all remote categories and replaces
30 // old suggestions by the new ones. The request to the server is performed as 30 // old suggestions by the new ones. The request to the server is performed as
31 // an background request. Background requests are used for actions not 31 // an background request. Background requests are used for actions not
32 // triggered by the user and have lower priority on the server. After the 32 // triggered by the user and have lower priority on the server. After the
33 // fetch finished, the provided |callback| will be triggered with the status 33 // fetch finished, the provided |callback| will be triggered with the status
34 // of the fetch (unless nullptr). 34 // of the fetch (unless nullptr).
35 // TODO(jkrcal): Change to FetchStatusCallback callback as callbacks already 35 virtual void RefetchInTheBackground(const FetchStatusCallback& callback) = 0;
36 // have is_empty() functionality. crbug.com/676317
37 virtual void RefetchInTheBackground(
38 std::unique_ptr<FetchStatusCallback> callback) = 0;
39 36
40 virtual const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging() 37 virtual const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging()
41 const = 0; 38 const = 0;
42 39
43 protected: 40 protected:
44 RemoteSuggestionsProvider(Observer* observer); 41 RemoteSuggestionsProvider(Observer* observer);
45 }; 42 };
46 43
47 } // namespace ntp_snippets 44 } // namespace ntp_snippets
48 45
49 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 46 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698