OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Gets a pointer to the singleton instance of the location relayer, which | 50 // Gets a pointer to the singleton instance of the location relayer, which |
51 // is in turn bound to the browser's global context objects. Ownership is NOT | 51 // is in turn bound to the browser's global context objects. Ownership is NOT |
52 // returned. | 52 // returned. |
53 static GeolocationProvider* GetInstance(); | 53 static GeolocationProvider* GetInstance(); |
54 | 54 |
55 typedef std::map<GeolocationObserver*, GeolocationObserverOptions> | 55 typedef std::map<GeolocationObserver*, GeolocationObserverOptions> |
56 ObserverMap; | 56 ObserverMap; |
57 | 57 |
58 private: | 58 private: |
59 friend struct DefaultSingletonTraits<GeolocationProvider>; | 59 friend struct DefaultSingletonTraits<GeolocationProvider>; |
60 ~GeolocationProvider(); | 60 virtual ~GeolocationProvider(); |
61 | 61 |
62 bool OnClientThread() const; | 62 bool OnClientThread() const; |
63 bool OnGeolocationThread() const; | 63 bool OnGeolocationThread() const; |
64 | 64 |
65 // When the observer list changes, we may start the thread and the required | 65 // When the observer list changes, we may start the thread and the required |
66 // providers, or stop them. | 66 // providers, or stop them. |
67 void OnObserversChanged(); | 67 void OnObserversChanged(); |
68 | 68 |
69 // Stop the providers when there are no more observers. Note that once our | 69 // Stop the providers when there are no more observers. Note that once our |
70 // thread is started, we'll keep it alive (but with no pending messages). | 70 // thread is started, we'll keep it alive (but with no pending messages). |
(...skipping 20 matching lines...) Expand all Loading... |
91 GURL most_recent_authorized_frame_; | 91 GURL most_recent_authorized_frame_; |
92 Geoposition position_; | 92 Geoposition position_; |
93 | 93 |
94 // Only to be used on the geolocation thread. | 94 // Only to be used on the geolocation thread. |
95 GeolocationArbitrator* arbitrator_; | 95 GeolocationArbitrator* arbitrator_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(GeolocationProvider); | 97 DISALLOW_COPY_AND_ASSIGN(GeolocationProvider); |
98 }; | 98 }; |
99 | 99 |
100 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_H_ | 100 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_H_ |
OLD | NEW |