| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/presentation/PresentationRequest.h" | 5 #include "modules/presentation/PresentationRequest.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 11 #include "core/dom/DOMException.h" | 11 #include "core/dom/DOMException.h" |
| 12 #include "core/dom/Document.h" | 12 #include "core/dom/Document.h" |
| 13 #include "core/dom/ExecutionContext.h" | 13 #include "core/dom/ExecutionContext.h" |
| 14 #include "core/dom/ExecutionContextTask.h" |
| 14 #include "core/frame/Settings.h" | 15 #include "core/frame/Settings.h" |
| 15 #include "core/frame/UseCounter.h" | 16 #include "core/frame/UseCounter.h" |
| 16 #include "core/loader/MixedContentChecker.h" | 17 #include "core/loader/MixedContentChecker.h" |
| 17 #include "modules/EventTargetModules.h" | 18 #include "modules/EventTargetModules.h" |
| 18 #include "modules/presentation/PresentationAvailability.h" | 19 #include "modules/presentation/PresentationAvailability.h" |
| 19 #include "modules/presentation/PresentationAvailabilityCallbacks.h" | 20 #include "modules/presentation/PresentationAvailabilityCallbacks.h" |
| 20 #include "modules/presentation/PresentationConnection.h" | 21 #include "modules/presentation/PresentationConnection.h" |
| 22 #include "modules/presentation/PresentationConnectionAvailableEvent.h" |
| 21 #include "modules/presentation/PresentationConnectionCallbacks.h" | 23 #include "modules/presentation/PresentationConnectionCallbacks.h" |
| 22 #include "modules/presentation/PresentationController.h" | 24 #include "modules/presentation/PresentationController.h" |
| 23 #include "modules/presentation/PresentationError.h" | 25 #include "modules/presentation/PresentationError.h" |
| 24 #include "platform/UserGestureIndicator.h" | 26 #include "platform/UserGestureIndicator.h" |
| 25 | 27 |
| 26 namespace blink { | 28 namespace blink { |
| 27 | 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 // TODO(mlamouri): refactor in one common place. | 32 // TODO(mlamouri): refactor in one common place. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 196 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| 195 client->getAvailability( | 197 client->getAvailability( |
| 196 m_url, new PresentationAvailabilityCallbacks(resolver, m_url)); | 198 m_url, new PresentationAvailabilityCallbacks(resolver, m_url)); |
| 197 return resolver->promise(); | 199 return resolver->promise(); |
| 198 } | 200 } |
| 199 | 201 |
| 200 const KURL& PresentationRequest::url() const { | 202 const KURL& PresentationRequest::url() const { |
| 201 return m_url; | 203 return m_url; |
| 202 } | 204 } |
| 203 | 205 |
| 206 void PresentationRequest::dispatchConnectionAvailableEvent( |
| 207 PresentationConnection* connection) { |
| 208 dispatchEvent(PresentationConnectionAvailableEvent::create( |
| 209 EventTypeNames::connectionavailable, connection)); |
| 210 } |
| 211 |
| 204 DEFINE_TRACE(PresentationRequest) { | 212 DEFINE_TRACE(PresentationRequest) { |
| 205 EventTargetWithInlineData::trace(visitor); | 213 EventTargetWithInlineData::trace(visitor); |
| 206 ActiveDOMObject::trace(visitor); | 214 ActiveDOMObject::trace(visitor); |
| 207 } | 215 } |
| 208 | 216 |
| 209 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, | 217 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, |
| 210 const KURL& url) | 218 const KURL& url) |
| 211 : ActiveScriptWrappable(this), | 219 : ActiveScriptWrappable(this), |
| 212 ActiveDOMObject(executionContext), | 220 ActiveDOMObject(executionContext), |
| 213 m_url(url) {} | 221 m_url(url) {} |
| 214 | 222 |
| 215 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |