Chromium Code Reviews| 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 CONTENT_PUBLIC_BROWSER_BACKGROUND_FETCH_CLIENT_H_ | |
| 6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_FETCH_CLIENT_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "content/common/content_export.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 // The BackgroundFetchClient provides a communication path for BackgroundFetch | |
| 15 // to use functionality provided by embedders to display offline content and | |
| 16 // notifications about ongoing BackgroundFetch operations. It also provides a | |
| 17 // mechanism for BackgroundFetch to provide a Delegate to allow embedders to | |
| 18 // control ongoing BackgroundFetch operations. | |
|
Peter Beverloo
2017/03/31 01:32:24
We use "Background Fetch" w/ space elsewhere.
I w
harkness
2017/03/31 10:11:45
Done.
| |
| 19 class CONTENT_EXPORT BackgroundFetchClient { | |
| 20 public: | |
| 21 // Class for access to the BackgroundFetch system. Manages in progress fetches | |
| 22 // and supports pause, resume, cancel, and UI update. | |
| 23 class CONTENT_EXPORT Delegate { | |
| 24 public: | |
| 25 // Cancel all fetches associated with the |registration_id|. | |
| 26 virtual void CancelDownload(const std::string& registration_id) = 0; | |
| 27 | |
| 28 // Pause all fetches associated with the |registration_id|. | |
| 29 virtual void PauseDownload(const std::string& registration_id) = 0; | |
| 30 | |
| 31 // Resume any fetches associated with the |registration_id|. | |
| 32 virtual void ResumeDownload(const std::string& registration_id) = 0; | |
| 33 | |
| 34 protected: | |
| 35 virtual ~Delegate() {} | |
| 36 }; | |
| 37 | |
| 38 // The Delegate provided is owned by the content layer. If a | |
| 39 // delegate has ever been set through SetDelegate, the content layer | |
| 40 // guarantees to call SetDelegate with |nullptr| before destroying the | |
| 41 // existing delegate. | |
|
Peter Beverloo
2017/03/31 01:32:24
The content layer is rather large and hard to reas
harkness
2017/03/31 10:11:44
Done.
| |
| 42 virtual void SetDelegate(Delegate* delegate) = 0; | |
| 43 | |
| 44 virtual ~BackgroundFetchClient() {} | |
|
Peter Beverloo
2017/03/31 01:32:24
Can this be protected?
harkness
2017/03/31 10:11:45
Done.
| |
| 45 }; | |
| 46 | |
| 47 } // namespace content | |
| 48 | |
| 49 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_FETCH_CLIENT_H_ | |
| OLD | NEW |