Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Side by Side Diff: chrome/browser/background_fetch/background_fetch_client_impl.h

Issue 2777063008: Connect BackgroundFetch to the OfflineItemCollection
Patch Set: Added BackgroundFetchClientProxy to proxy calls to and from the Context. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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;
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;
Peter Beverloo 2017/03/31 01:32:22 Definitely show this to dtrainor@.
harkness 2017/03/31 10:11:43 Acknowledged.
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 content::BackgroundFetchClient::Delegate* delegate_;
Peter Beverloo 2017/03/31 01:32:23 // The |delegate_| is owned externally and will re
harkness 2017/03/31 10:11:43 Done.
58
59 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientImpl);
60 };
61
62 #endif // CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698