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