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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 Document* document = this->document(); | 148 Document* document = this->document(); |
| 149 ASSERT(document); | 149 ASSERT(document); |
| 150 | 150 |
| 151 // It is required by isSecureContext() but isn't | 151 // It is required by isSecureContext() but isn't |
| 152 // actually used. This could be used later if a warning is shown in the | 152 // actually used. This could be used later if a warning is shown in the |
| 153 // developer console. | 153 // developer console. |
| 154 String insecureOriginMsg; | 154 String insecureOriginMsg; |
| 155 if (document->isSecureContext(insecureOriginMsg)) { | 155 if (document->isSecureContext(insecureOriginMsg)) { |
| 156 UseCounter::count(document, UseCounter::GeolocationSecureOrigin); | 156 UseCounter::count(document, UseCounter::GeolocationSecureOrigin); |
| 157 UseCounter::countCrossOriginIframe(*document, UseCounter::GeolocationSec ureOriginIframe); | 157 UseCounter::countCrossOriginIframe(*document, UseCounter::GeolocationSec ureOriginIframe); |
| 158 } else if (frame()->settings()->allowGeolocationOnInsecureOrigins()) { | |
| 159 // TODO(jww): This should be removed after WebView is fixed so that it | |
|
Rick Byers
2016/05/04 13:57:07
nit: have a bug number to reference?
jww
2016/05/05 19:17:41
Done.
| |
| 160 // disallows geolocation in insecure contexts. | |
| 161 Deprecation::countDeprecation(document, UseCounter::GeolocationInsecureO riginDeprecatedNotRemoved); | |
| 162 Deprecation::countDeprecationCrossOriginIframe(*document, UseCounter::Ge olocationInsecureOriginIframeDeprecatedNotRemoved); | |
| 163 OriginsUsingFeatures::countAnyWorld(*document, OriginsUsingFeatures::Fea ture::GeolocationInsecureOrigin); | |
| 158 } else { | 164 } else { |
| 159 Deprecation::countDeprecation(document, UseCounter::GeolocationInsecureO rigin); | 165 Deprecation::countDeprecation(document, UseCounter::GeolocationInsecureO rigin); |
| 160 Deprecation::countDeprecationCrossOriginIframe(*document, UseCounter::Ge olocationInsecureOriginIframe); | 166 Deprecation::countDeprecationCrossOriginIframe(*document, UseCounter::Ge olocationInsecureOriginIframe); |
| 161 OriginsUsingFeatures::countAnyWorld(*document, OriginsUsingFeatures::Fea ture::GeolocationInsecureOrigin); | 167 OriginsUsingFeatures::countAnyWorld(*document, OriginsUsingFeatures::Fea ture::GeolocationInsecureOrigin); |
| 162 } | 168 } |
| 163 } | 169 } |
| 164 | 170 |
| 165 void Geolocation::getCurrentPosition(PositionCallback* successCallback, Position ErrorCallback* errorCallback, const PositionOptions& options) | 171 void Geolocation::getCurrentPosition(PositionCallback* successCallback, Position ErrorCallback* errorCallback, const PositionOptions& options) |
| 166 { | 172 { |
| 167 if (!frame()) | 173 if (!frame()) |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 notifier->startTimer(); | 540 notifier->startTimer(); |
| 535 else | 541 else |
| 536 notifier->setFatalError(PositionError::create(PositionError::POS ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); | 542 notifier->setFatalError(PositionError::create(PositionError::POS ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); |
| 537 } else { | 543 } else { |
| 538 notifier->setFatalError(PositionError::create(PositionError::PERMISS ION_DENIED, permissionDeniedErrorMessage)); | 544 notifier->setFatalError(PositionError::create(PositionError::PERMISS ION_DENIED, permissionDeniedErrorMessage)); |
| 539 } | 545 } |
| 540 } | 546 } |
| 541 } | 547 } |
| 542 | 548 |
| 543 } // namespace blink | 549 } // namespace blink |
| OLD | NEW |