Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / child / geofencing / web_geofencing_provider_impl.h
blobf10981885ea024ed6f8bc9935b4ff9793e24b298
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.
5 #ifndef CONTENT_CHILD_GEOFENCING_WEB_GEOFENCING_PROVIDER_IMPL_H_
6 #define CONTENT_CHILD_GEOFENCING_WEB_GEOFENCING_PROVIDER_IMPL_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11 #include "third_party/WebKit/public/platform/WebGeofencingProvider.h"
13 namespace content {
14 class GeofencingDispatcher;
15 class ThreadSafeSender;
17 class CONTENT_EXPORT WebGeofencingProviderImpl
18 : NON_EXPORTED_BASE(public blink::WebGeofencingProvider) {
19 public:
20 explicit WebGeofencingProviderImpl(ThreadSafeSender* thread_safe_sender);
21 virtual ~WebGeofencingProviderImpl();
23 // Enables mock geofencing service. |service_available| indicates if the
24 // mock service should mock geofencing being available or not.
25 void SetMockProvider(bool service_available);
26 // Disables mock geofencing service.
27 void ClearMockProvider();
28 // Set the mock geofencing position.
29 void SetMockPosition(double latitude, double longitude);
31 private:
32 // WebGeofencingProvider implementation.
33 virtual void registerRegion(
34 const blink::WebString& regionId,
35 const blink::WebCircularGeofencingRegion& region,
36 blink::WebServiceWorkerRegistration* service_worker_registration,
37 blink::WebGeofencingCallbacks* callbacks);
38 virtual void unregisterRegion(
39 const blink::WebString& regionId,
40 blink::WebServiceWorkerRegistration* service_worker_registration,
41 blink::WebGeofencingCallbacks* callbacks);
42 virtual void getRegisteredRegions(
43 blink::WebServiceWorkerRegistration* service_worker_registration,
44 blink::WebGeofencingRegionsCallbacks* callbacks);
46 GeofencingDispatcher* GetDispatcher();
48 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
50 DISALLOW_COPY_AND_ASSIGN(WebGeofencingProviderImpl);
53 } // namespace content
55 #endif // CONTENT_CHILD_GEOFENCING_WEB_GEOFENCING_PROVIDER_IMPL_H_