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_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_SERVICE_H_ |
6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_SERVICE_H_ | 6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/common/geofencing_types.h" | 13 #include "content/common/geofencing_types.h" |
14 | 14 |
| 15 namespace base { |
15 template <typename T> | 16 template <typename T> |
16 struct DefaultSingletonTraits; | 17 struct DefaultSingletonTraits; |
| 18 } |
17 | 19 |
18 namespace blink { | 20 namespace blink { |
19 struct WebCircularGeofencingRegion; | 21 struct WebCircularGeofencingRegion; |
20 }; | 22 }; |
21 | 23 |
22 namespace content { | 24 namespace content { |
23 | 25 |
24 class GeofencingProvider; | 26 class GeofencingProvider; |
25 class GeofencingRegistrationDelegate; | 27 class GeofencingRegistrationDelegate; |
26 | 28 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 64 |
63 // GeofencingServiceInterface implementation. | 65 // GeofencingServiceInterface implementation. |
64 bool IsServiceAvailable() override; | 66 bool IsServiceAvailable() override; |
65 int64 RegisterRegion( | 67 int64 RegisterRegion( |
66 const blink::WebCircularGeofencingRegion& region, | 68 const blink::WebCircularGeofencingRegion& region, |
67 GeofencingRegistrationDelegate* delegate) override; | 69 GeofencingRegistrationDelegate* delegate) override; |
68 void UnregisterRegion(int64 geofencing_registration_id) override; | 70 void UnregisterRegion(int64 geofencing_registration_id) override; |
69 | 71 |
70 protected: | 72 protected: |
71 friend class GeofencingServiceTest; | 73 friend class GeofencingServiceTest; |
72 friend struct DefaultSingletonTraits<GeofencingServiceImpl>; | 74 friend struct base::DefaultSingletonTraits<GeofencingServiceImpl>; |
73 GeofencingServiceImpl(); | 75 GeofencingServiceImpl(); |
74 ~GeofencingServiceImpl() override; | 76 ~GeofencingServiceImpl() override; |
75 | 77 |
76 void SetProviderForTesting(scoped_ptr<GeofencingProvider> provider); | 78 void SetProviderForTesting(scoped_ptr<GeofencingProvider> provider); |
77 int RegistrationCountForTesting(); | 79 int RegistrationCountForTesting(); |
78 | 80 |
79 private: | 81 private: |
80 struct Registration; | 82 struct Registration; |
81 typedef std::map<int64, Registration> RegistrationsMap; | 83 typedef std::map<int64, Registration> RegistrationsMap; |
82 | 84 |
(...skipping 13 matching lines...) Expand all Loading... |
96 int64 next_registration_id_; | 98 int64 next_registration_id_; |
97 RegistrationsMap registrations_; | 99 RegistrationsMap registrations_; |
98 scoped_ptr<GeofencingProvider> provider_; | 100 scoped_ptr<GeofencingProvider> provider_; |
99 | 101 |
100 DISALLOW_COPY_AND_ASSIGN(GeofencingServiceImpl); | 102 DISALLOW_COPY_AND_ASSIGN(GeofencingServiceImpl); |
101 }; | 103 }; |
102 | 104 |
103 } // namespace content | 105 } // namespace content |
104 | 106 |
105 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_SERVICE_H_ | 107 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_SERVICE_H_ |
OLD | NEW |