| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_ |
| 7 |
| 8 #include <list> |
| 9 |
| 10 namespace content { |
| 11 class GeolocationServiceImpl; |
| 12 |
| 13 // Provides information to a set of GeolocationServiceImpl instances that are |
| 14 // associated with a given context. Notably, allows pausing and resuming |
| 15 // geolocation on these instances. |
| 16 class GeolocationServiceImplContext { |
| 17 public: |
| 18 GeolocationServiceImplContext(); |
| 19 virtual ~GeolocationServiceImplContext(); |
| 20 |
| 21 // Adds and removes a service to this context. |
| 22 void AddService(GeolocationServiceImpl* service); |
| 23 void RemoveService(GeolocationServiceImpl* service); |
| 24 |
| 25 // Pauses and resumes geolocation. Resuming when nothing is paused is a |
| 26 // no-op. If a service is added while geolocation is paused, that service |
| 27 // will not get geolocation updates until geolocation is resumed. |
| 28 void PauseUpdates(); |
| 29 void ResumeUpdates(); |
| 30 |
| 31 // Returns whether geolocation updates are currently paused. |
| 32 bool paused() { return paused_; } |
| 33 |
| 34 private: |
| 35 std::list<GeolocationServiceImpl*> attached_services_; |
| 36 bool paused_; |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_ |
| OLD | NEW |