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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 { | 288 { |
289 LocalFrame* frame = this->frame(); | 289 LocalFrame* frame = this->frame(); |
290 if (!frame) | 290 if (!frame) |
291 return 0; | 291 return 0; |
292 | 292 |
293 m_lastPosition = createGeoposition(GeolocationController::from(frame)->lastP
osition()); | 293 m_lastPosition = createGeoposition(GeolocationController::from(frame)->lastP
osition()); |
294 | 294 |
295 return m_lastPosition.get(); | 295 return m_lastPosition.get(); |
296 } | 296 } |
297 | 297 |
298 void Geolocation::getCurrentPosition(PassOwnPtr<PositionCallback> successCallbac
k, PassOwnPtr<PositionErrorCallback> errorCallback, PositionOptions* options) | 298 void Geolocation::getCurrentPosition(PassOwnPtr<PositionCallback> successCallbac
k, PassOwnPtr<PositionErrorCallback> errorCallback, const Dictionary& options) |
299 { | 299 { |
300 if (!frame()) | 300 if (!frame()) |
301 return; | 301 return; |
302 | 302 |
303 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, options); | 303 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, PositionOptions::create(options)); |
304 startRequest(notifier); | 304 startRequest(notifier); |
305 | 305 |
306 m_oneShots.add(notifier); | 306 m_oneShots.add(notifier); |
307 } | 307 } |
308 | 308 |
309 int Geolocation::watchPosition(PassOwnPtr<PositionCallback> successCallback, Pas
sOwnPtr<PositionErrorCallback> errorCallback, PositionOptions* options) | 309 int Geolocation::watchPosition(PassOwnPtr<PositionCallback> successCallback, Pas
sOwnPtr<PositionErrorCallback> errorCallback, const Dictionary& options) |
310 { | 310 { |
311 if (!frame()) | 311 if (!frame()) |
312 return 0; | 312 return 0; |
313 | 313 |
314 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, options); | 314 GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCall
back, PositionOptions::create(options)); |
315 startRequest(notifier); | 315 startRequest(notifier); |
316 | 316 |
317 int watchID; | 317 int watchID; |
318 // Keep asking for the next id until we're given one that we don't already h
ave. | 318 // Keep asking for the next id until we're given one that we don't already h
ave. |
319 do { | 319 do { |
320 watchID = executionContext()->circularSequentialID(); | 320 watchID = executionContext()->circularSequentialID(); |
321 } while (!m_watchers.add(watchID, notifier)); | 321 } while (!m_watchers.add(watchID, notifier)); |
322 return watchID; | 322 return watchID; |
323 } | 323 } |
324 | 324 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 notifier->startTimer(); | 675 notifier->startTimer(); |
676 else | 676 else |
677 notifier->setFatalError(PositionError::create(PositionError::POS
ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); | 677 notifier->setFatalError(PositionError::create(PositionError::POS
ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); |
678 } else { | 678 } else { |
679 notifier->setFatalError(PositionError::create(PositionError::PERMISS
ION_DENIED, permissionDeniedErrorMessage)); | 679 notifier->setFatalError(PositionError::create(PositionError::PERMISS
ION_DENIED, permissionDeniedErrorMessage)); |
680 } | 680 } |
681 } | 681 } |
682 } | 682 } |
683 | 683 |
684 } // namespace WebCore | 684 } // namespace WebCore |
OLD | NEW |