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 #include "content/public/browser/background_fetch_delegate.h" | |
13 | |
14 namespace content { | |
15 class BackgroundFetchDelegate; | |
16 } // namespace content | |
17 | |
18 class Profile; | |
19 | |
20 using offline_items_collection::ContentId; | |
21 using offline_items_collection::OfflineItem; | |
22 using offline_items_collection::OfflineContentProvider; | |
harkness
2017/03/29 08:02:05
I know we don't usually use "using", but is it all
Peter Beverloo
2017/03/29 14:32:12
Wow this is terrible, hehe. Unfortunately we don't
harkness
2017/03/30 12:42:35
Done.
| |
23 | |
24 class BackgroundFetchClientImpl : public content::BackgroundFetchClient, | |
25 public OfflineContentProvider, | |
26 public KeyedService { | |
27 public: | |
28 explicit BackgroundFetchClientImpl(Profile* profile); | |
29 ~BackgroundFetchClientImpl() override; | |
30 | |
31 // content::BackgroundFetchClient overrides. | |
32 void SetDelegate(content::BackgroundFetchDelegate* delegate) override; | |
33 content::BackgroundFetchDelegate* GetDelegate() const override; | |
34 | |
35 // components::OfflineContentProvider overrides. | |
36 bool AreItemsAvailable() override; | |
37 void OpenItem(const ContentId& id) override; | |
38 void RemoveItem(const ContentId& id) override; | |
39 void CancelDownload(const ContentId& id) override; | |
40 void PauseDownload(const ContentId& id) override; | |
41 void ResumeDownload(const ContentId& id) override; | |
42 const OfflineItem* GetItemById(const ContentId& id) override; | |
43 OfflineContentProvider::OfflineItemList GetAllItems() override; | |
44 void AddObserver(Observer* observer) override; | |
45 void RemoveObserver(Observer* observer) override; | |
46 | |
47 private: | |
48 // This object is owned by the Profile. | |
49 Profile* profile_; | |
50 | |
51 // Guaranteed to outlive this object. | |
Peter Beverloo
2017/03/29 14:32:12
why?
harkness
2017/03/30 12:42:35
oops, I thought it was when I started, then forgot
| |
52 content::BackgroundFetchDelegate* delegate_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientImpl); | |
55 }; | |
56 | |
57 #endif // CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ | |
OLD | NEW |