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_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 Loading... |
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 |
| 36 // have is_empty() functionality. crbug.com/676317 |
35 virtual void RefetchInTheBackground( | 37 virtual void RefetchInTheBackground( |
36 std::unique_ptr<FetchStatusCallback> callback) = 0; | 38 std::unique_ptr<FetchStatusCallback> callback) = 0; |
37 | 39 |
38 virtual const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging() | 40 virtual const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging() |
39 const = 0; | 41 const = 0; |
40 | 42 |
41 protected: | 43 protected: |
42 RemoteSuggestionsProvider(Observer* observer); | 44 RemoteSuggestionsProvider(Observer* observer); |
43 }; | 45 }; |
44 | 46 |
45 } // namespace ntp_snippets | 47 } // namespace ntp_snippets |
46 | 48 |
47 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ | 49 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ |
OLD | NEW |