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 CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_H_ |
6 #define CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_H_ | 6 #define CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_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 | 10 |
11 struct OneGoogleBarData; | 11 struct OneGoogleBarData; |
12 | 12 |
13 // Interface for fetching OneGoogleBarData over the network. | 13 // Interface for fetching OneGoogleBarData over the network. |
14 class OneGoogleBarFetcher { | 14 class OneGoogleBarFetcher { |
15 public: | 15 public: |
16 using OneGoogleCallback = | 16 using OneGoogleCallback = |
17 base::OnceCallback<void(const base::Optional<OneGoogleBarData>&)>; | 17 base::OnceCallback<void(const base::Optional<OneGoogleBarData>&)>; |
18 | 18 |
| 19 virtual ~OneGoogleBarFetcher() = default; |
| 20 |
19 // Initiates a fetch from the network. On completion (successful or not), the | 21 // Initiates a fetch from the network. On completion (successful or not), the |
20 // callback will be called with the result, which will be nullopt on failure. | 22 // callback will be called with the result, which will be nullopt on failure. |
21 virtual void Fetch(OneGoogleCallback callback) = 0; | 23 virtual void Fetch(OneGoogleCallback callback) = 0; |
22 }; | 24 }; |
23 | 25 |
24 #endif // CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_H_ | 26 #endif // CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_H_ |
OLD | NEW |