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_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_ |
6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
9 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
10 #include "content/common/geofencing_types.h" | 11 #include "content/common/geofencing_types.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 struct WebCircularGeofencingRegion; | 14 struct WebCircularGeofencingRegion; |
14 }; | 15 }; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 class GeofencingProvider { | 19 class GeofencingProvider { |
19 public: | 20 public: |
20 typedef base::Callback<void(GeofencingStatus)> StatusCallback; | 21 typedef base::Callback<void(GeofencingStatus)> StatusCallback; |
21 | 22 |
22 virtual ~GeofencingProvider() {} | 23 virtual ~GeofencingProvider() {} |
23 | 24 |
24 // Called by |GeofencingService| to register a new fence. GeofencingService is | 25 // Called by |GeofencingService| to register a new fence. GeofencingService is |
25 // responsible for handling things like duplicate regions, so platform | 26 // responsible for handling things like duplicate regions, so platform |
26 // specific implementations shouldn't have to worry about things like that. | 27 // specific implementations shouldn't have to worry about things like that. |
27 // Also GeofencingService should be making sure the total number of geofences | 28 // Also GeofencingService should be making sure the total number of geofences |
28 // that is registered with the platform specific provider does not exceed the | 29 // that is registered with the platform specific provider does not exceed the |
29 // number of regions supported by the platform, although that isn't | 30 // number of regions supported by the platform, although that isn't |
30 // implemented yet. | 31 // implemented yet. |
31 // Implementations of RegisterRegion must asynchronously call the |callback| | 32 // Implementations of RegisterRegion must asynchronously call the |callback| |
32 // to indicate success or failure. | 33 // to indicate success or failure. |
33 virtual void RegisterRegion(int64 geofencing_registration_id, | 34 virtual void RegisterRegion(int64_t geofencing_registration_id, |
34 const blink::WebCircularGeofencingRegion& region, | 35 const blink::WebCircularGeofencingRegion& region, |
35 const StatusCallback& callback) = 0; | 36 const StatusCallback& callback) = 0; |
36 | 37 |
37 // Called by |GeofencingService| to unregister an existing registration. Will | 38 // Called by |GeofencingService| to unregister an existing registration. Will |
38 // only be called once for each registration. | 39 // only be called once for each registration. |
39 virtual void UnregisterRegion(int64 geofencing_registration_id) = 0; | 40 virtual void UnregisterRegion(int64_t geofencing_registration_id) = 0; |
40 }; | 41 }; |
41 | 42 |
42 } // namespace content | 43 } // namespace content |
43 | 44 |
44 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_ | 45 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_ |
OLD | NEW |