| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_DOODLE_DOODLE_FETCHER_H_ | 5 #ifndef COMPONENTS_DOODLE_DOODLE_FETCHER_H_ |
| 6 #define COMPONENTS_DOODLE_DOODLE_FETCHER_H_ | 6 #define COMPONENTS_DOODLE_DOODLE_FETCHER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "components/doodle/doodle_types.h" | 10 #include "components/doodle/doodle_types.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // |doodle_config| will only contain a value if |state| is AVAILABLE. | 22 // |doodle_config| will only contain a value if |state| is AVAILABLE. |
| 23 using FinishedCallback = base::OnceCallback<void( | 23 using FinishedCallback = base::OnceCallback<void( |
| 24 DoodleState state, | 24 DoodleState state, |
| 25 const base::Optional<DoodleConfig>& doodle_config)>; | 25 const base::Optional<DoodleConfig>& doodle_config)>; |
| 26 | 26 |
| 27 virtual ~DoodleFetcher() = default; | 27 virtual ~DoodleFetcher() = default; |
| 28 | 28 |
| 29 // Fetches a doodle asynchronously. The |callback| is called with a | 29 // Fetches a doodle asynchronously. The |callback| is called with a |
| 30 // DoodleState indicating whether the request succeded in fetching a doodle. | 30 // DoodleState indicating whether the request succeded in fetching a doodle. |
| 31 // If a fetch is already running, the callback will be queued and invoked with | 31 // If a fetch is already running, the callback will be queued and invoked with |
| 32 // result from the next completed request. | 32 // the result from the next completed request. |
| 33 virtual void FetchDoodle(FinishedCallback callback) = 0; | 33 virtual void FetchDoodle(FinishedCallback callback) = 0; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace doodle | 36 } // namespace doodle |
| 37 | 37 |
| 38 #endif // COMPONENTS_DOODLE_DOODLE_FETCHER_H_ | 38 #endif // COMPONENTS_DOODLE_DOODLE_FETCHER_H_ |
| OLD | NEW |