OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void removeObserver(Geolocation*); | 51 void removeObserver(Geolocation*); |
52 | 52 |
53 void requestPermission(Geolocation*); | 53 void requestPermission(Geolocation*); |
54 void cancelPermissionRequest(Geolocation*); | 54 void cancelPermissionRequest(Geolocation*); |
55 | 55 |
56 void positionChanged(GeolocationPosition*); | 56 void positionChanged(GeolocationPosition*); |
57 void errorOccurred(GeolocationError*); | 57 void errorOccurred(GeolocationError*); |
58 | 58 |
59 GeolocationPosition* lastPosition(); | 59 GeolocationPosition* lastPosition(); |
60 | 60 |
61 GeolocationClient* client() { return m_client; } | |
62 | |
63 // Inherited from PageLifecycleObserver. | 61 // Inherited from PageLifecycleObserver. |
64 virtual void pageVisibilityChanged() OVERRIDE; | 62 virtual void pageVisibilityChanged() OVERRIDE; |
65 | 63 |
66 static const char* supplementName(); | 64 static const char* supplementName(); |
67 static GeolocationController* from(Page* page) { return static_cast<Geolocat
ionController*>(Supplement<Page>::from(page, supplementName())); } | 65 static GeolocationController* from(Page* page) { return static_cast<Geolocat
ionController*>(Supplement<Page>::from(page, supplementName())); } |
68 | 66 |
69 private: | 67 private: |
70 GeolocationController(Page*, GeolocationClient*); | 68 GeolocationController(Page*, GeolocationClient*); |
71 | 69 |
| 70 void startUpdatingIfNeeded(); |
| 71 void stopUpdatingIfNeeded(); |
| 72 |
72 GeolocationClient* m_client; | 73 GeolocationClient* m_client; |
73 | 74 |
74 RefPtr<GeolocationPosition> m_lastPosition; | 75 RefPtr<GeolocationPosition> m_lastPosition; |
75 typedef HashSet<RefPtr<Geolocation> > ObserversSet; | 76 typedef HashSet<RefPtr<Geolocation> > ObserversSet; |
76 // All observers; both those requesting high accuracy and those not. | 77 // All observers; both those requesting high accuracy and those not. |
77 ObserversSet m_observers; | 78 ObserversSet m_observers; |
78 ObserversSet m_highAccuracyObservers; | 79 ObserversSet m_highAccuracyObservers; |
| 80 bool m_isClientUpdating; |
79 }; | 81 }; |
80 | 82 |
81 } // namespace WebCore | 83 } // namespace WebCore |
82 | 84 |
83 #endif // GeolocationController_h | 85 #endif // GeolocationController_h |
OLD | NEW |