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 21 matching lines...) Expand all Loading... |
32 #include "modules/geolocation/Geoposition.h" | 32 #include "modules/geolocation/Geoposition.h" |
33 #include "modules/geolocation/PositionCallback.h" | 33 #include "modules/geolocation/PositionCallback.h" |
34 #include "modules/geolocation/PositionError.h" | 34 #include "modules/geolocation/PositionError.h" |
35 #include "modules/geolocation/PositionErrorCallback.h" | 35 #include "modules/geolocation/PositionErrorCallback.h" |
36 #include "modules/geolocation/PositionOptions.h" | 36 #include "modules/geolocation/PositionOptions.h" |
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 Dictionary; |
42 class Document; | 43 class Document; |
43 class LocalFrame; | 44 class LocalFrame; |
44 class GeolocationController; | 45 class GeolocationController; |
45 class GeolocationError; | 46 class GeolocationError; |
46 class GeolocationPosition; | 47 class GeolocationPosition; |
47 class ExecutionContext; | 48 class ExecutionContext; |
48 | 49 |
49 class Geolocation FINAL | 50 class Geolocation FINAL |
50 : public GarbageCollectedFinalized<Geolocation> | 51 : public GarbageCollectedFinalized<Geolocation> |
51 , public ScriptWrappable | 52 , public ScriptWrappable |
52 , public ActiveDOMObject { | 53 , public ActiveDOMObject { |
53 public: | 54 public: |
54 static Geolocation* create(ExecutionContext*); | 55 static Geolocation* create(ExecutionContext*); |
55 virtual ~Geolocation(); | 56 virtual ~Geolocation(); |
56 void trace(Visitor*); | 57 void trace(Visitor*); |
57 | 58 |
58 virtual void stop() OVERRIDE; | 59 virtual void stop() OVERRIDE; |
59 Document* document() const; | 60 Document* document() const; |
60 LocalFrame* frame() const; | 61 LocalFrame* frame() const; |
61 | 62 |
62 // Creates a oneshot and attempts to obtain a position that meets the | 63 // Creates a oneshot and attempts to obtain a position that meets the |
63 // constraints of the options. | 64 // constraints of the options. |
64 void getCurrentPosition(PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErr
orCallback>, PositionOptions*); | 65 void getCurrentPosition(PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErr
orCallback>, const Dictionary&); |
65 | 66 |
66 // Creates a watcher that will be notified whenever a new position is | 67 // Creates a watcher that will be notified whenever a new position is |
67 // available that meets the constraints of the options. | 68 // available that meets the constraints of the options. |
68 int watchPosition(PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErrorCall
back>, PositionOptions*); | 69 int watchPosition(PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErrorCall
back>, const Dictionary&); |
69 | 70 |
70 // Removes all references to the watcher, it will not be updated again. | 71 // Removes all references to the watcher, it will not be updated again. |
71 void clearWatch(int watchID); | 72 void clearWatch(int watchID); |
72 | 73 |
73 void setIsAllowed(bool); | 74 void setIsAllowed(bool); |
74 | 75 |
75 bool isAllowed() const { return m_allowGeolocation == Yes; } | 76 bool isAllowed() const { return m_allowGeolocation == Yes; } |
76 | 77 |
77 // Notifies this that a new position is available. Must never be called | 78 // Notifies this that a new position is available. Must never be called |
78 // before permission is granted by the user. | 79 // before permission is granted by the user. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 Yes, | 238 Yes, |
238 No | 239 No |
239 } m_allowGeolocation; | 240 } m_allowGeolocation; |
240 | 241 |
241 GeoNotifierSet m_requestsAwaitingCachedPosition; | 242 GeoNotifierSet m_requestsAwaitingCachedPosition; |
242 }; | 243 }; |
243 | 244 |
244 } // namespace WebCore | 245 } // namespace WebCore |
245 | 246 |
246 #endif // Geolocation_h | 247 #endif // Geolocation_h |
OLD | NEW |