| 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 CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ | 6 #define CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/child/worker_task_runner.h" | 11 #include "content/child/worker_task_runner.h" |
| 12 #include "content/common/geofencing_status.h" | 12 #include "content/common/geofencing_types.h" |
| 13 #include "third_party/WebKit/public/platform/WebGeofencingProvider.h" | 13 #include "third_party/WebKit/public/platform/WebGeofencingProvider.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class MessageLoop; | 16 class MessageLoop; |
| 17 class TaskRunner; | 17 class TaskRunner; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace IPC { | 20 namespace IPC { |
| 21 class Message; | 21 class Message; |
| 22 } | 22 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 blink::WebServiceWorkerRegistration* service_worker_registration, | 39 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 40 blink::WebGeofencingCallbacks* callbacks); | 40 blink::WebGeofencingCallbacks* callbacks); |
| 41 void UnregisterRegion( | 41 void UnregisterRegion( |
| 42 const blink::WebString& region_id, | 42 const blink::WebString& region_id, |
| 43 blink::WebServiceWorkerRegistration* service_worker_registration, | 43 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 44 blink::WebGeofencingCallbacks* callbacks); | 44 blink::WebGeofencingCallbacks* callbacks); |
| 45 void GetRegisteredRegions( | 45 void GetRegisteredRegions( |
| 46 blink::WebServiceWorkerRegistration* service_worker_registration, | 46 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 47 blink::WebGeofencingRegionsCallbacks* callbacks); | 47 blink::WebGeofencingRegionsCallbacks* callbacks); |
| 48 | 48 |
| 49 // Enables mock geofencing service. |service_available| indicates if the |
| 50 // mock service should mock geofencing being available or not. |
| 51 void SetMockProvider(bool service_available); |
| 52 // Disables mock geofencing service. |
| 53 void ClearMockProvider(); |
| 54 // Set the mock geofencing position. |
| 55 void SetMockPosition(double latitude, double longitude); |
| 56 |
| 49 // |thread_safe_sender| needs to be passed in because if the call leads to | 57 // |thread_safe_sender| needs to be passed in because if the call leads to |
| 50 // construction it will be needed. | 58 // construction it will be needed. |
| 51 static GeofencingDispatcher* GetOrCreateThreadSpecificInstance( | 59 static GeofencingDispatcher* GetOrCreateThreadSpecificInstance( |
| 52 ThreadSafeSender* thread_safe_sender); | 60 ThreadSafeSender* thread_safe_sender); |
| 53 | 61 |
| 54 // Unlike GetOrCreateThreadSpecificInstance() this doesn't create a new | 62 // Unlike GetOrCreateThreadSpecificInstance() this doesn't create a new |
| 55 // instance if thread-local instance doesn't exist. | 63 // instance if thread-local instance doesn't exist. |
| 56 static GeofencingDispatcher* GetThreadSpecificInstance(); | 64 static GeofencingDispatcher* GetThreadSpecificInstance(); |
| 57 | 65 |
| 58 private: | 66 private: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 78 region_unregistration_requests_; | 86 region_unregistration_requests_; |
| 79 IDMap<blink::WebGeofencingRegionsCallbacks, IDMapOwnPointer> | 87 IDMap<blink::WebGeofencingRegionsCallbacks, IDMapOwnPointer> |
| 80 get_registered_regions_requests_; | 88 get_registered_regions_requests_; |
| 81 | 89 |
| 82 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcher); | 90 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcher); |
| 83 }; | 91 }; |
| 84 | 92 |
| 85 } // namespace content | 93 } // namespace content |
| 86 | 94 |
| 87 #endif // CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ | 95 #endif // CONTENT_CHILD_GEOFENCING_GEOFENCING_DISPATCHER_H_ |
| OLD | NEW |