OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTROLLER_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
| 13 class BackgroundSyncManager; |
| 14 |
13 // An interface that the Background Sync API uses to access services from the | 15 // An interface that the Background Sync API uses to access services from the |
14 // embedder. Must only be used on the UI thread. | 16 // embedder. Must only be used on the UI thread. |
15 class CONTENT_EXPORT BackgroundSyncController { | 17 class CONTENT_EXPORT BackgroundSyncController { |
16 public: | 18 public: |
17 virtual ~BackgroundSyncController() {} | 19 virtual ~BackgroundSyncController() {} |
18 | 20 |
19 // Notification that a service worker registration with origin |origin| just | 21 // Notification that a service worker registration with origin |origin| just |
20 // registered a background sync event. | 22 // registered a background sync event. |
21 virtual void NotifyBackgroundSyncRegistered(const GURL& origin) {} | 23 virtual void NotifyBackgroundSyncRegistered(const GURL& origin) {} |
| 24 |
| 25 // Register the |registrant|'s interest (or disinterest) in starting the |
| 26 // browser the next time the device goes online after the browser has closed. |
| 27 // This only needs to be implemented by browsers; WebView and other embedders |
| 28 // which should not have their application relaunched by Background Sync can |
| 29 // use the default implentation. |
| 30 virtual void LaunchBrowserWhenNextOnline( |
| 31 const BackgroundSyncManager* registrant, |
| 32 bool launch_when_next_online) {} |
22 }; | 33 }; |
23 | 34 |
24 } // namespace content | 35 } // namespace content |
25 | 36 |
26 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTROLLER_H_ | 37 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTROLLER_H_ |
OLD | NEW |