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/WebPassOwnPtr.h" | |
10 #include "public/platform/WebVector.h" | 9 #include "public/platform/WebVector.h" |
11 | 10 |
12 namespace blink { | 11 namespace blink { |
13 | 12 |
14 struct WebCircularGeofencingRegion; | 13 struct WebCircularGeofencingRegion; |
15 struct WebGeofencingError; | 14 struct WebGeofencingError; |
16 struct WebGeofencingRegistration; | 15 struct WebGeofencingRegistration; |
17 class WebServiceWorkerRegistration; | 16 class WebServiceWorkerRegistration; |
18 class WebString; | 17 class WebString; |
19 | 18 |
20 using WebGeofencingCallbacks = WebCallbacks<void, WebPassOwnPtr<WebGeofencingErr
or>>; | 19 using WebGeofencingCallbacks = WebCallbacks<void, const WebGeofencingError&>; |
21 using WebGeofencingRegionsCallbacks = WebCallbacks<WebPassOwnPtr<WebVector<WebGe
ofencingRegistration>>, WebPassOwnPtr<WebGeofencingError>>; | 20 using WebGeofencingRegionsCallbacks = WebCallbacks<const WebVector<WebGeofencing
Registration>&, const WebGeofencingError&>; |
22 | 21 |
23 class WebGeofencingProvider { | 22 class WebGeofencingProvider { |
24 public: | 23 public: |
25 virtual ~WebGeofencingProvider() { } | 24 virtual ~WebGeofencingProvider() { } |
26 | 25 |
27 // Registers a region. | 26 // Registers a region. |
28 // Ownership of the WebGeofencingCallbacks is transferred to the client. | 27 // Ownership of the WebGeofencingCallbacks is transferred to the client. |
29 virtual void registerRegion(const WebString& regionId, const WebCircularGeof
encingRegion&, WebServiceWorkerRegistration*, WebGeofencingCallbacks*) { } | 28 virtual void registerRegion(const WebString& regionId, const WebCircularGeof
encingRegion&, WebServiceWorkerRegistration*, WebGeofencingCallbacks*) { } |
30 | 29 |
31 // Unregisters a region. | 30 // Unregisters a region. |
32 // Ownership of the WebGeofencingCallbacks is transferred to the client. | 31 // Ownership of the WebGeofencingCallbacks is transferred to the client. |
33 virtual void unregisterRegion(const WebString& regionId, WebServiceWorkerReg
istration*, WebGeofencingCallbacks*) { } | 32 virtual void unregisterRegion(const WebString& regionId, WebServiceWorkerReg
istration*, WebGeofencingCallbacks*) { } |
34 | 33 |
35 // Returns all the currently registered regions. | 34 // Returns all the currently registered regions. |
36 // Ownership of the WebGeofencingRegionsCallbacks is transferred to the clie
nt. | 35 // Ownership of the WebGeofencingRegionsCallbacks is transferred to the clie
nt. |
37 virtual void getRegisteredRegions(WebServiceWorkerRegistration*, WebGeofenci
ngRegionsCallbacks*) { } | 36 virtual void getRegisteredRegions(WebServiceWorkerRegistration*, WebGeofenci
ngRegionsCallbacks*) { } |
38 }; | 37 }; |
39 | 38 |
40 } // namespace blink | 39 } // namespace blink |
41 | 40 |
42 #endif // WebGeofencingProvider_h | 41 #endif // WebGeofencingProvider_h |
OLD | NEW |