Chromium Code Reviews| Index: chrome/browser/background_fetch/background_fetch_client_impl.h |
| diff --git a/chrome/browser/background_fetch/background_fetch_client_impl.h b/chrome/browser/background_fetch/background_fetch_client_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cee89bb08a9c741022042dd8066f63ad96b4fb1b |
| --- /dev/null |
| +++ b/chrome/browser/background_fetch/background_fetch_client_impl.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ |
| +#define CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ |
| + |
| +#include "base/macros.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| +#include "components/offline_items_collection/core/offline_content_provider.h" |
| +#include "content/public/browser/background_fetch_client.h" |
| + |
| +namespace offline_items_collection { |
| +class OfflineContentProvider; |
| +struct ContentId; |
| +struct OfflineItem; |
| +} // namespace offline_items_collection |
| + |
| +class Profile; |
| + |
| +class BackgroundFetchClientImpl |
| + : public content::BackgroundFetchClient, |
| + public offline_items_collection::OfflineContentProvider, |
| + public KeyedService { |
| + public: |
| + explicit BackgroundFetchClientImpl(Profile* profile); |
| + ~BackgroundFetchClientImpl() override; |
| + |
| + // KeyedService override. |
| + void Shutdown() override; |
| + |
| + // content::BackgroundFetchClient implementation. |
| + void SetDelegate(content::BackgroundFetchClient::Delegate* delegate) override; |
| + |
| + // components::offline_items_collection::OfflineContentProvider overrides. |
| + bool AreItemsAvailable() override; |
| + void OpenItem(const offline_items_collection::ContentId& content_id) override; |
| + void RemoveItem( |
| + 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.
|
| + void CancelDownload( |
| + const offline_items_collection::ContentId& content_id) override; |
| + void PauseDownload( |
| + const offline_items_collection::ContentId& content_id) override; |
| + void ResumeDownload( |
| + const offline_items_collection::ContentId& content_id) override; |
| + const offline_items_collection::OfflineItem* GetItemById( |
| + const offline_items_collection::ContentId& content_id) override; |
| + offline_items_collection::OfflineContentProvider::OfflineItemList |
| + GetAllItems() override; |
| + void AddObserver(Observer* observer) override; |
| + void RemoveObserver(Observer* observer) override; |
| + |
| + private: |
| + // This object is owned by the Profile. |
| + Profile* profile_; |
| + |
| + 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.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientImpl); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_IMPL_H_ |