OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. |
3 * Copyright 2010, The Android Open Source Project | 3 * Copyright 2010, The Android Open Source Project |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "platform/Timer.h" | 37 #include "platform/Timer.h" |
38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class Document; | 42 class Document; |
43 class LocalFrame; | 43 class LocalFrame; |
44 class GeolocationController; | 44 class GeolocationController; |
45 class GeolocationError; | 45 class GeolocationError; |
46 class GeolocationPosition; | 46 class GeolocationPosition; |
47 class Page; | |
48 class ExecutionContext; | 47 class ExecutionContext; |
49 | 48 |
50 class Geolocation FINAL : public RefCountedWillBeGarbageCollectedFinalized<Geolo
cation>, public ScriptWrappable, public ActiveDOMObject | 49 class Geolocation FINAL : public RefCountedWillBeGarbageCollectedFinalized<Geolo
cation>, public ScriptWrappable, public ActiveDOMObject |
51 { | 50 { |
52 public: | 51 public: |
53 static PassRefPtrWillBeRawPtr<Geolocation> create(ExecutionContext*); | 52 static PassRefPtrWillBeRawPtr<Geolocation> create(ExecutionContext*); |
54 virtual ~Geolocation(); | 53 virtual ~Geolocation(); |
55 void trace(Visitor*); | 54 void trace(Visitor*); |
56 | 55 |
57 virtual void stop() OVERRIDE; | 56 virtual void stop() OVERRIDE; |
(...skipping 23 matching lines...) Expand all Loading... |
81 void setError(GeolocationError*); | 80 void setError(GeolocationError*); |
82 | 81 |
83 private: | 82 private: |
84 // Returns the last known position, if any. May return null. | 83 // Returns the last known position, if any. May return null. |
85 Geoposition* lastPosition(); | 84 Geoposition* lastPosition(); |
86 | 85 |
87 bool isDenied() const { return m_allowGeolocation == No; } | 86 bool isDenied() const { return m_allowGeolocation == No; } |
88 | 87 |
89 explicit Geolocation(ExecutionContext*); | 88 explicit Geolocation(ExecutionContext*); |
90 | 89 |
91 Page* page() const; | |
92 | |
93 // Holds the success and error callbacks and the options that were provided | 90 // Holds the success and error callbacks and the options that were provided |
94 // when a oneshot or watcher were created. Also, if specified in the | 91 // when a oneshot or watcher were created. Also, if specified in the |
95 // options, manages a timer to limit the time to wait for the system to | 92 // options, manages a timer to limit the time to wait for the system to |
96 // obtain a position. | 93 // obtain a position. |
97 class GeoNotifier : public RefCountedWillBeGarbageCollectedFinalized<GeoNoti
fier> { | 94 class GeoNotifier : public RefCountedWillBeGarbageCollectedFinalized<GeoNoti
fier> { |
98 public: | 95 public: |
99 static PassRefPtrWillBeRawPtr<GeoNotifier> create(Geolocation* geolocati
on, PassOwnPtr<PositionCallback> positionCallback, PassOwnPtr<PositionErrorCallb
ack> positionErrorCallback, PassRefPtrWillBeRawPtr<PositionOptions> options) | 96 static PassRefPtrWillBeRawPtr<GeoNotifier> create(Geolocation* geolocati
on, PassOwnPtr<PositionCallback> positionCallback, PassOwnPtr<PositionErrorCallb
ack> positionErrorCallback, PassRefPtrWillBeRawPtr<PositionOptions> options) |
100 { | 97 { |
101 return adoptRefWillBeNoop(new GeoNotifier(geolocation, positionCallb
ack, positionErrorCallback, options)); | 98 return adoptRefWillBeNoop(new GeoNotifier(geolocation, positionCallb
ack, positionErrorCallback, options)); |
102 } | 99 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 Yes, | 235 Yes, |
239 No | 236 No |
240 } m_allowGeolocation; | 237 } m_allowGeolocation; |
241 | 238 |
242 GeoNotifierSet m_requestsAwaitingCachedPosition; | 239 GeoNotifierSet m_requestsAwaitingCachedPosition; |
243 }; | 240 }; |
244 | 241 |
245 } // namespace WebCore | 242 } // namespace WebCore |
246 | 243 |
247 #endif // Geolocation_h | 244 #endif // Geolocation_h |
OLD | NEW |