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 (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
4 * Copyright 2010, The Android Open Source Project | 4 * Copyright 2010, The Android Open Source Project |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 { | 130 { |
131 LocalFrame* frame = this->frame(); | 131 LocalFrame* frame = this->frame(); |
132 if (!frame) | 132 if (!frame) |
133 return 0; | 133 return 0; |
134 | 134 |
135 m_lastPosition = createGeoposition(GeolocationController::from(frame)->lastP
osition()); | 135 m_lastPosition = createGeoposition(GeolocationController::from(frame)->lastP
osition()); |
136 | 136 |
137 return m_lastPosition.get(); | 137 return m_lastPosition.get(); |
138 } | 138 } |
139 | 139 |
140 void Geolocation::getCurrentPosition(PassOwnPtrWillBeRawPtr<PositionCallback> su
ccessCallback, PassOwnPtrWillBeRawPtr<PositionErrorCallback> errorCallback, cons
t Dictionary& options) | 140 void Geolocation::getCurrentPosition(PositionCallback* successCallback, Position
ErrorCallback* errorCallback, const Dictionary& options) |
141 { | 141 { |
142 if (!frame()) | 142 if (!frame()) |
143 return; | 143 return; |
144 | 144 |
145 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, PositionOptions::create(options)); | 145 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, PositionOptions::create(options)); |
146 startRequest(notifier); | 146 startRequest(notifier); |
147 | 147 |
148 m_oneShots.add(notifier); | 148 m_oneShots.add(notifier); |
149 } | 149 } |
150 | 150 |
151 int Geolocation::watchPosition(PassOwnPtrWillBeRawPtr<PositionCallback> successC
allback, PassOwnPtrWillBeRawPtr<PositionErrorCallback> errorCallback, const Dict
ionary& options) | 151 int Geolocation::watchPosition(PositionCallback* successCallback, PositionErrorC
allback* errorCallback, const Dictionary& options) |
152 { | 152 { |
153 if (!frame()) | 153 if (!frame()) |
154 return 0; | 154 return 0; |
155 | 155 |
156 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, PositionOptions::create(options)); | 156 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, PositionOptions::create(options)); |
157 startRequest(notifier); | 157 startRequest(notifier); |
158 | 158 |
159 int watchID; | 159 int watchID; |
160 // Keep asking for the next id until we're given one that we don't already h
ave. | 160 // Keep asking for the next id until we're given one that we don't already h
ave. |
161 do { | 161 do { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 notifier->startTimer(); | 516 notifier->startTimer(); |
517 else | 517 else |
518 notifier->setFatalError(PositionError::create(PositionError::POS
ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); | 518 notifier->setFatalError(PositionError::create(PositionError::POS
ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); |
519 } else { | 519 } else { |
520 notifier->setFatalError(PositionError::create(PositionError::PERMISS
ION_DENIED, permissionDeniedErrorMessage)); | 520 notifier->setFatalError(PositionError::create(PositionError::PERMISS
ION_DENIED, permissionDeniedErrorMessage)); |
521 } | 521 } |
522 } | 522 } |
523 } | 523 } |
524 | 524 |
525 } // namespace blink | 525 } // namespace blink |
OLD | NEW |