| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 419 |
| 420 LocalFrame* frame = this->frame(); | 420 LocalFrame* frame = this->frame(); |
| 421 if (!frame) | 421 if (!frame) |
| 422 return; | 422 return; |
| 423 | 423 |
| 424 m_geolocationPermission = PermissionRequested; | 424 m_geolocationPermission = PermissionRequested; |
| 425 frame->interfaceProvider()->getInterface(mojo::GetProxy(&m_permissionService
)); | 425 frame->interfaceProvider()->getInterface(mojo::GetProxy(&m_permissionService
)); |
| 426 m_permissionService.set_connection_error_handler(convertToBaseCallback(WTF::
bind(&Geolocation::onPermissionConnectionError, wrapWeakPersistent(this)))); | 426 m_permissionService.set_connection_error_handler(convertToBaseCallback(WTF::
bind(&Geolocation::onPermissionConnectionError, wrapWeakPersistent(this)))); |
| 427 | 427 |
| 428 // Ask the embedder: it maintains the geolocation challenge policy itself. | 428 // Ask the embedder: it maintains the geolocation challenge policy itself. |
| 429 auto descriptor = mojom::blink::PermissionDescriptor::New(); |
| 430 descriptor->name = mojom::blink::PermissionName::GEOLOCATION; |
| 429 m_permissionService->RequestPermission( | 431 m_permissionService->RequestPermission( |
| 430 mojom::blink::PermissionName::GEOLOCATION, | 432 std::move(descriptor), |
| 431 getExecutionContext()->getSecurityOrigin(), | 433 getExecutionContext()->getSecurityOrigin(), |
| 432 UserGestureIndicator::processingUserGesture(), | 434 UserGestureIndicator::processingUserGesture(), |
| 433 convertToBaseCallback(WTF::bind(&Geolocation::onGeolocationPermissionUpd
ated, wrapPersistent(this)))); | 435 convertToBaseCallback(WTF::bind(&Geolocation::onGeolocationPermissionUpd
ated, wrapPersistent(this)))); |
| 434 } | 436 } |
| 435 | 437 |
| 436 void Geolocation::makeSuccessCallbacks() | 438 void Geolocation::makeSuccessCallbacks() |
| 437 { | 439 { |
| 438 DCHECK(m_lastPosition); | 440 DCHECK(m_lastPosition); |
| 439 DCHECK(isAllowed()); | 441 DCHECK(isAllowed()); |
| 440 | 442 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 // be called. In that case, blink has already shut down so do nothing. | 546 // be called. In that case, blink has already shut down so do nothing. |
| 545 // | 547 // |
| 546 // TODO(sammc): Remove this once renderer shutdown is no longer graceful. | 548 // TODO(sammc): Remove this once renderer shutdown is no longer graceful. |
| 547 if (!Platform::current()) | 549 if (!Platform::current()) |
| 548 return; | 550 return; |
| 549 | 551 |
| 550 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); | 552 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
| 551 } | 553 } |
| 552 | 554 |
| 553 } // namespace blink | 555 } // namespace blink |
| OLD | NEW |