OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ | |
6 #define CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/keyed_service/core/keyed_service.h" | |
10 #include "components/offline_items_collection/core/offline_content_provider.h" | |
11 #include "content/public/browser/background_fetch_client.h" | |
12 | |
13 namespace offline_items_collection { | |
14 class OfflineContentProvider; | |
Peter Beverloo
2017/03/31 11:54:06
nit: you're including and using OCP, no need to fo
harkness
2017/04/03 12:47:22
Done.
| |
15 struct ContentId; | |
16 struct OfflineItem; | |
17 } // namespace offline_items_collection | |
18 | |
19 class Profile; | |
20 | |
21 class BackgroundFetchClientImpl | |
22 : public content::BackgroundFetchClient, | |
23 public offline_items_collection::OfflineContentProvider, | |
24 public KeyedService { | |
25 public: | |
26 explicit BackgroundFetchClientImpl(Profile* profile); | |
27 ~BackgroundFetchClientImpl() override; | |
28 | |
29 // KeyedService override. | |
30 void Shutdown() override; | |
31 | |
32 // content::BackgroundFetchClient implementation. | |
33 void SetDelegate(content::BackgroundFetchClient::Delegate* delegate) override; | |
34 | |
35 // components::offline_items_collection::OfflineContentProvider overrides. | |
36 bool AreItemsAvailable() override; | |
37 void OpenItem(const offline_items_collection::ContentId& content_id) override; | |
38 void RemoveItem( | |
39 const offline_items_collection::ContentId& content_id) override; | |
40 void CancelDownload( | |
41 const offline_items_collection::ContentId& content_id) override; | |
42 void PauseDownload( | |
43 const offline_items_collection::ContentId& content_id) override; | |
44 void ResumeDownload( | |
45 const offline_items_collection::ContentId& content_id) override; | |
46 const offline_items_collection::OfflineItem* GetItemById( | |
47 const offline_items_collection::ContentId& content_id) override; | |
48 offline_items_collection::OfflineContentProvider::OfflineItemList | |
49 GetAllItems() override; | |
50 void AddObserver(Observer* observer) override; | |
51 void RemoveObserver(Observer* observer) override; | |
52 | |
53 private: | |
54 // This object is owned by the Profile. | |
55 Profile* profile_; | |
56 | |
57 // The |delegate| is owned externally and will remove itself prior to | |
58 // deletion. | |
59 content::BackgroundFetchClient::Delegate* delegate_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientImpl); | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ | |
OLD | NEW |