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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // 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 |
36 // will not get geolocation updates until geolocation is resumed. | 36 // will not get geolocation updates until geolocation is resumed. |
37 void PauseUpdates(); | 37 void PauseUpdates(); |
38 void ResumeUpdates(); | 38 void ResumeUpdates(); |
39 | 39 |
40 // Returns whether geolocation updates are currently paused. | 40 // Returns whether geolocation updates are currently paused. |
41 bool paused() { return paused_; } | 41 bool paused() { return paused_; } |
42 | 42 |
43 // Enables geolocation override. This method can be used to trigger possible | 43 // Enables geolocation override. This method can be used to trigger possible |
44 // location-specific behavior in a particular context. | 44 // location-specific behavior in a particular context. |
45 void SetOverride(scoped_ptr<Geoposition> geoposition); | 45 void SetOverride(std::unique_ptr<Geoposition> geoposition); |
46 | 46 |
47 // Disables geolocation override. | 47 // Disables geolocation override. |
48 void ClearOverride(); | 48 void ClearOverride(); |
49 | 49 |
50 private: | 50 private: |
51 ScopedVector<GeolocationServiceImpl> services_; | 51 ScopedVector<GeolocationServiceImpl> services_; |
52 bool paused_; | 52 bool paused_; |
53 | 53 |
54 scoped_ptr<Geoposition> geoposition_override_; | 54 std::unique_ptr<Geoposition> geoposition_override_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceContext); | 56 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceContext); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace content | 59 } // namespace content |
60 | 60 |
61 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ | 61 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_CONTEXT_H_ |
OLD | NEW |