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_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ | 5 #ifndef DEVICE_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ | 6 #define DEVICE_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "content/browser/geolocation/geolocation_service_impl.h" | 10 #include "device/geolocation/geolocation_export.h" |
11 #include "third_party/WebKit/public/platform/modules/geolocation/geolocation.moj
om.h" | 11 #include "third_party/WebKit/public/platform/modules/geolocation/geolocation.moj
om.h" |
12 | 12 |
13 namespace content { | 13 namespace device { |
| 14 |
| 15 class GeolocationServiceImpl; |
| 16 struct Geoposition; |
14 | 17 |
15 // Provides information to a set of GeolocationServiceImpl instances that are | 18 // Provides information to a set of GeolocationServiceImpl instances that are |
16 // associated with a given context. Notably, allows pausing and resuming | 19 // associated with a given context. Notably, allows pausing and resuming |
17 // geolocation on these instances. | 20 // geolocation on these instances. |
18 class GeolocationServiceContext { | 21 class DEVICE_GEOLOCATION_EXPORT GeolocationServiceContext { |
19 public: | 22 public: |
20 GeolocationServiceContext(); | 23 GeolocationServiceContext(); |
21 virtual ~GeolocationServiceContext(); | 24 virtual ~GeolocationServiceContext(); |
22 | 25 |
23 // Creates a GeolocationServiceImpl that is weakly bound to |request|. | 26 // Creates a GeolocationServiceImpl that is weakly bound to |request|. |
24 // |update_callback| will be called when services send | 27 // |update_callback| will be called when services send |
25 // location updates to their clients. | 28 // location updates to their clients. |
26 void CreateService( | 29 void CreateService( |
27 const base::Closure& update_callback, | 30 const base::Closure& update_callback, |
28 mojo::InterfaceRequest<blink::mojom::GeolocationService> request); | 31 mojo::InterfaceRequest<blink::mojom::GeolocationService> request); |
(...skipping 20 matching lines...) Expand all Loading... |
49 | 52 |
50 private: | 53 private: |
51 ScopedVector<GeolocationServiceImpl> services_; | 54 ScopedVector<GeolocationServiceImpl> services_; |
52 bool paused_; | 55 bool paused_; |
53 | 56 |
54 std::unique_ptr<Geoposition> geoposition_override_; | 57 std::unique_ptr<Geoposition> geoposition_override_; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceContext); | 59 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceContext); |
57 }; | 60 }; |
58 | 61 |
59 } // namespace content | 62 } // namespace device |
60 | 63 |
61 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ | 64 #endif // DEVICE_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ |
OLD | NEW |