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 CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_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 "content/browser/geolocation/geolocation_service_impl.h" |
| 11 #include "third_party/WebKit/public/platform/modules/geolocation/geolocation.moj
om.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 // Provides information to a set of GeolocationServiceImpl instances that are | 15 // Provides information to a set of GeolocationServiceImpl instances that are |
15 // associated with a given context. Notably, allows pausing and resuming | 16 // associated with a given context. Notably, allows pausing and resuming |
16 // geolocation on these instances. | 17 // geolocation on these instances. |
17 class GeolocationServiceContext { | 18 class GeolocationServiceContext { |
18 public: | 19 public: |
19 GeolocationServiceContext(); | 20 GeolocationServiceContext(); |
20 virtual ~GeolocationServiceContext(); | 21 virtual ~GeolocationServiceContext(); |
21 | 22 |
22 // Creates a GeolocationServiceImpl that is weakly bound to |request|. | 23 // Creates a GeolocationServiceImpl that is weakly bound to |request|. |
23 // |update_callback| will be called when services send | 24 // |update_callback| will be called when services send |
24 // location updates to their clients. | 25 // location updates to their clients. |
25 void CreateService(const base::Closure& update_callback, | 26 void CreateService( |
26 mojo::InterfaceRequest<GeolocationService> request); | 27 const base::Closure& update_callback, |
| 28 mojo::InterfaceRequest<blink::mojom::GeolocationService> request); |
27 | 29 |
28 // Called when a service has a connection error. After this call, it is no | 30 // Called when a service has a connection error. After this call, it is no |
29 // longer safe to access |service|. | 31 // longer safe to access |service|. |
30 void ServiceHadConnectionError(GeolocationServiceImpl* service); | 32 void ServiceHadConnectionError(GeolocationServiceImpl* service); |
31 | 33 |
32 // Pauses and resumes geolocation. Resuming when nothing is paused is a | 34 // Pauses and resumes geolocation. Resuming when nothing is paused is a |
33 // no-op. If a service is added while geolocation is paused, that service | 35 // no-op. If a service is added while geolocation is paused, that service |
34 // will not get geolocation updates until geolocation is resumed. | 36 // will not get geolocation updates until geolocation is resumed. |
35 void PauseUpdates(); | 37 void PauseUpdates(); |
36 void ResumeUpdates(); | 38 void ResumeUpdates(); |
(...skipping 13 matching lines...) Expand all Loading... |
50 bool paused_; | 52 bool paused_; |
51 | 53 |
52 scoped_ptr<Geoposition> geoposition_override_; | 54 scoped_ptr<Geoposition> geoposition_override_; |
53 | 55 |
54 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceContext); | 56 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceContext); |
55 }; | 57 }; |
56 | 58 |
57 } // namespace content | 59 } // namespace content |
58 | 60 |
59 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ | 61 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ |
OLD | NEW |