Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 #include "modules/geolocation/Geolocation.h" | 29 #include "modules/geolocation/Geolocation.h" |
| 30 | 30 |
| 31 #include "core/dom/DOMException.h" | |
| 31 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/dom/ExceptionCode.h" | |
| 32 #include "modules/geolocation/Coordinates.h" | 34 #include "modules/geolocation/Coordinates.h" |
| 35 #include "modules/geolocation/GeofencingRegion.h" | |
| 33 #include "modules/geolocation/GeolocationController.h" | 36 #include "modules/geolocation/GeolocationController.h" |
| 34 #include "modules/geolocation/GeolocationError.h" | 37 #include "modules/geolocation/GeolocationError.h" |
| 35 #include "modules/geolocation/GeolocationPosition.h" | 38 #include "modules/geolocation/GeolocationPosition.h" |
| 36 #include "wtf/CurrentTime.h" | 39 #include "wtf/CurrentTime.h" |
| 37 | 40 |
| 38 namespace WebCore { | 41 namespace WebCore { |
| 39 | 42 |
| 40 static const char permissionDeniedErrorMessage[] = "User denied Geolocation"; | 43 static const char permissionDeniedErrorMessage[] = "User denied Geolocation"; |
| 41 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocat ion service"; | 44 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocat ion service"; |
| 42 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents"; | 45 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents"; |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 674 if (startUpdating(notifier)) | 677 if (startUpdating(notifier)) |
| 675 notifier->startTimer(); | 678 notifier->startTimer(); |
| 676 else | 679 else |
| 677 notifier->setFatalError(PositionError::create(PositionError::POS ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); | 680 notifier->setFatalError(PositionError::create(PositionError::POS ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); |
| 678 } else { | 681 } else { |
| 679 notifier->setFatalError(PositionError::create(PositionError::PERMISS ION_DENIED, permissionDeniedErrorMessage)); | 682 notifier->setFatalError(PositionError::create(PositionError::PERMISS ION_DENIED, permissionDeniedErrorMessage)); |
| 680 } | 683 } |
| 681 } | 684 } |
| 682 } | 685 } |
| 683 | 686 |
| 687 ScriptPromise Geolocation::registerRegion(ScriptState* scriptState, GeofencingRe gion* region) | |
| 688 { | |
| 689 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::crea te(NotSupportedError)); | |
|
Peter Beverloo
2014/07/10 16:31:36
Could we perhaps add a very basic layout test to v
Marijn Kruisselbrink
2014/07/11 10:06:39
Done (although it seems a bit silly to write tests
| |
| 690 } | |
| 691 | |
| 692 ScriptPromise Geolocation::unregisterRegion(ScriptState* scriptState, const Stri ng& regionId) | |
| 693 { | |
| 694 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::crea te(NotSupportedError)); | |
|
Peter Beverloo
2014/07/10 16:31:37
dito.
Marijn Kruisselbrink
2014/07/11 10:06:39
Done.
| |
| 695 } | |
| 696 | |
| 697 ScriptPromise Geolocation::getRegisteredRegions(ScriptState* scriptState) const | |
| 698 { | |
| 699 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::crea te(NotSupportedError)); | |
|
Peter Beverloo
2014/07/10 16:31:37
dito.
Marijn Kruisselbrink
2014/07/11 10:06:39
Done.
| |
| 700 } | |
| 701 | |
| 684 } // namespace WebCore | 702 } // namespace WebCore |
| OLD | NEW |