OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_CHILD_GEOFENCING_WEB_GEOFENCING_PROVIDER_IMPL_H_ | |
6 #define CONTENT_CHILD_GEOFENCING_WEB_GEOFENCING_PROVIDER_IMPL_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "base/macros.h" | |
10 #include "base/memory/ref_counted.h" | |
11 #include "content/common/content_export.h" | |
12 #include "third_party/WebKit/public/platform/WebGeofencingProvider.h" | |
13 | |
14 namespace content { | |
15 class GeofencingDispatcher; | |
16 class ThreadSafeSender; | |
17 | |
18 class CONTENT_EXPORT WebGeofencingProviderImpl | |
19 : NON_EXPORTED_BASE(public blink::WebGeofencingProvider) { | |
20 public: | |
21 explicit WebGeofencingProviderImpl(ThreadSafeSender* thread_safe_sender); | |
22 ~WebGeofencingProviderImpl() override; | |
23 | |
24 // Enables mock geofencing service. |service_available| indicates if the | |
25 // mock service should mock geofencing being available or not. | |
26 void SetMockProvider(bool service_available); | |
27 // Disables mock geofencing service. | |
28 void ClearMockProvider(); | |
29 // Set the mock geofencing position. | |
30 void SetMockPosition(double latitude, double longitude); | |
31 | |
32 private: | |
33 // WebGeofencingProvider implementation. | |
34 void registerRegion( | |
35 const blink::WebString& regionId, | |
36 const blink::WebCircularGeofencingRegion& region, | |
37 blink::WebServiceWorkerRegistration* service_worker_registration, | |
38 blink::WebGeofencingCallbacks* callbacks) override; | |
39 void unregisterRegion( | |
40 const blink::WebString& regionId, | |
41 blink::WebServiceWorkerRegistration* service_worker_registration, | |
42 blink::WebGeofencingCallbacks* callbacks) override; | |
43 void getRegisteredRegions( | |
44 blink::WebServiceWorkerRegistration* service_worker_registration, | |
45 blink::WebGeofencingRegionsCallbacks* callbacks) override; | |
46 | |
47 GeofencingDispatcher* GetDispatcher(); | |
48 | |
49 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(WebGeofencingProviderImpl); | |
52 }; | |
53 | |
54 } // namespace content | |
55 | |
56 #endif // CONTENT_CHILD_GEOFENCING_WEB_GEOFENCING_PROVIDER_IMPL_H_ | |
OLD | NEW |