OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebGeofencingProvider_h | 5 #ifndef WebGeofencingProvider_h |
6 #define WebGeofencingProvider_h | 6 #define WebGeofencingProvider_h |
7 | 7 |
8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
9 #include "public/platform/WebVector.h" | 9 #include "public/platform/WebVector.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 struct WebCircularGeofencingRegion; | 13 struct WebCircularGeofencingRegion; |
14 struct WebGeofencingError; | 14 struct WebGeofencingError; |
15 struct WebGeofencingRegistration; | 15 struct WebGeofencingRegistration; |
| 16 class WebServiceWorkerRegistration; |
16 class WebString; | 17 class WebString; |
17 | 18 |
18 typedef WebCallbacks<void, WebGeofencingError> WebGeofencingCallbacks; | 19 typedef WebCallbacks<void, WebGeofencingError> WebGeofencingCallbacks; |
19 typedef WebCallbacks<WebVector<WebGeofencingRegistration>, WebGeofencingError> W
ebGeofencingRegionsCallbacks; | 20 typedef WebCallbacks<WebVector<WebGeofencingRegistration>, WebGeofencingError> W
ebGeofencingRegionsCallbacks; |
20 | 21 |
21 class WebGeofencingProvider { | 22 class WebGeofencingProvider { |
22 public: | 23 public: |
23 virtual ~WebGeofencingProvider() { } | 24 virtual ~WebGeofencingProvider() { } |
24 | 25 |
25 // Registers a region. | 26 // Registers a region. |
26 // Ownership of the WebGeofencingCallbacks is transferred to the client. | 27 // Ownership of the WebGeofencingCallbacks is transferred to the client. |
27 virtual void registerRegion(const WebString& regionId, const WebCircularGeof
encingRegion&, WebGeofencingCallbacks*) = 0; | 28 virtual void registerRegion(const WebString& regionId, const WebCircularGeof
encingRegion&, WebGeofencingCallbacks*) { } |
| 29 virtual void registerRegion(const WebString& regionId, const WebCircularGeof
encingRegion&, WebServiceWorkerRegistration*, WebGeofencingCallbacks*) { } |
28 | 30 |
29 // Unregisters a region. | 31 // Unregisters a region. |
30 // Ownership of the WebGeofencingCallbacks is transferred to the client. | 32 // Ownership of the WebGeofencingCallbacks is transferred to the client. |
31 virtual void unregisterRegion(const WebString& regionId, WebGeofencingCallba
cks*) = 0; | 33 virtual void unregisterRegion(const WebString& regionId, WebGeofencingCallba
cks*) { } |
| 34 virtual void unregisterRegion(const WebString& regionId, WebServiceWorkerReg
istration*, WebGeofencingCallbacks*) { } |
32 | 35 |
33 // Returns all the currently registered regions. | 36 // Returns all the currently registered regions. |
34 // Ownership of the WebGeofencingRegionsCallbacks is transferred to the clie
nt. | 37 // Ownership of the WebGeofencingRegionsCallbacks is transferred to the clie
nt. |
35 virtual void getRegisteredRegions(WebGeofencingRegionsCallbacks*) = 0; | 38 virtual void getRegisteredRegions(WebGeofencingRegionsCallbacks*) { } |
| 39 virtual void getRegisteredRegions(WebServiceWorkerRegistration*, WebGeofenci
ngRegionsCallbacks*) { } |
36 }; | 40 }; |
37 | 41 |
38 } // namespace blink | 42 } // namespace blink |
39 | 43 |
40 #endif // WebGeofencingProvider_h | 44 #endif // WebGeofencingProvider_h |
OLD | NEW |