bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatures::FeatureType type, bool defaultValue) { if (!m_client) return defaultValue; switch (type) { case ContextFeatures::StyleScoped: return m_client->allowWebComponents(WebDocument(document), defaultValue); case ContextFeatures::MutationEvents: return m_client->allowMutationEvents(WebDocument(document), defaultValue); case ContextFeatures::PushState: return m_client->allowPushState(WebDocument(document)); default: return defaultValue; } }
WebDocument WebNode::document() const { return WebDocument(m_private->document()); }
WebDocument WebUserMediaRequest::ownerDocument() const { ASSERT(!isNull()); return WebDocument(m_private->ownerDocument()); }
WebDocument WebElement::document() const { return WebDocument(constUnwrap<Element>()->document()); }
WebDocument WebRemoteFrameImpl::document() const { // TODO(dcheng): this should also ASSERT_NOT_REACHED, but a lot of // code tries to access the document of a remote frame at the moment. return WebDocument(); }
WebDocument WebRemoteFrameImpl::document() const { return WebDocument(); }
WebDocument WebLocalFrameImpl::document() const { if (!frame() || !frame()->document()) return WebDocument(); return WebDocument(frame()->document()); }
WebDocument WebMediaDevicesRequest::ownerDocument() const { DCHECK(!isNull()); return WebDocument(m_private->ownerDocument()); }