Exemple #1
0
void TextFinder::reportFindInPageResultToAccessibility(int identifier) {
  if (!m_activeMatch)
    return;

  AXObjectCacheImpl* axObjectCache = toAXObjectCacheImpl(
      ownerFrame().frame()->document()->existingAXObjectCache());
  if (!axObjectCache)
    return;

  AXObject* startObject = axObjectCache->get(m_activeMatch->startContainer());
  AXObject* endObject = axObjectCache->get(m_activeMatch->endContainer());
  if (!startObject || !endObject)
    return;

  // Notify the client of new text marker data.
  axObjectCache->postNotification(
      startObject, AXObjectCache::AXNotification::AXChildrenChanged);
  if (startObject != endObject)
    axObjectCache->postNotification(
        endObject, AXObjectCache::AXNotification::AXChildrenChanged);

  if (ownerFrame().client()) {
    ownerFrame().client()->handleAccessibilityFindInPageResult(
        identifier, m_activeMatchIndex + 1, WebAXObject(startObject),
        m_activeMatch->startOffset(), WebAXObject(endObject),
        m_activeMatch->endOffset());
  }
}
Exemple #2
0
WebAXObject WebDocument::accessibilityObject() const {
  const Document* document = constUnwrap<Document>();
  AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache());
  return cache ? WebAXObject(cache->getOrCreate(
                     toLayoutView(LayoutAPIShim::layoutObjectFrom(
                         document->layoutViewItem()))))
               : WebAXObject();
}
void AccessibilityController::reset()
{
    m_rootElement = WebAXObject();
    m_focusedElement = WebAXObject();
    m_elements.clear();
    m_notificationCallbacks.clear();

    m_logAccessibilityEvents = false;
}
void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCache::AXNotification notification)
{
    // Alert assistive technology about the accessibility object notification.
    if (!obj || !obj->document())
        return;

    WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()->axObjectCacheOwner().frame());
    if (webframe && webframe->client())
        webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEvent(notification));

    // FIXME: delete these lines once Chrome only uses the frame client interface, above.
    if (m_webView->client())
        m_webView->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEvent(notification));
}
void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCache::AXNotification notification)
{
    // Alert assistive technology about the accessibility object notification.
    if (!obj)
        return;
    if (m_webView->client())
        m_webView->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEvent(notification));
}
Exemple #6
0
 void postAccessibilityNotification(
     AXObject* obj,
     AXObjectCache::AXNotification notification) override {
   WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(
       m_popup->m_popupClient->ownerElement().document().frame());
   if (obj && frame && frame->client())
     frame->client()->postAccessibilityEvent(
         WebAXObject(obj), static_cast<WebAXEvent>(notification));
 }
void TextFinder::reportFindInPageResultToAccessibility(int identifier)
{
    AXObjectCacheImpl* axObjectCache = toAXObjectCacheImpl(ownerFrame().frame()->document()->existingAXObjectCache());
    if (!axObjectCache)
        return;

    AXObject* startObject = axObjectCache->get(m_activeMatch->startContainer());
    AXObject* endObject = axObjectCache->get(m_activeMatch->endContainer());
    if (!startObject || !endObject)
        return;

    WebLocalFrameImpl* mainFrameImpl = ownerFrame().viewImpl()->mainFrameImpl();
    if (mainFrameImpl && mainFrameImpl->client()) {
        mainFrameImpl->client()->handleAccessibilityFindInPageResult(
            identifier, m_activeMatchIndexInCurrentFrame + 1,
            WebAXObject(startObject), m_activeMatch->startOffset(),
            WebAXObject(endObject), m_activeMatch->endOffset());
    }
}
void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCache::AXNotification notification)
{
    // Alert assistive technology about the accessibility object notification.
    if (!obj || !obj->document())
        return;

    WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()->axObjectCacheOwner().frame());
    if (webframe && webframe->client())
        webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEvent(notification));
}
Exemple #9
0
WebAXObject WebDocument::focusedAccessibilityObject() const {
  const Document* document = constUnwrap<Document>();
  AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache());
  return cache ? WebAXObject(cache->focusedObject()) : WebAXObject();
}
Exemple #10
0
WebAXObject WebDocument::accessibilityObjectFromID(int axID) const {
  const Document* document = constUnwrap<Document>();
  AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache());
  return cache ? WebAXObject(cache->objectFromAXID(axID)) : WebAXObject();
}
WebAXObject WebDocument::accessibilityObjectFromID(int axID) const
{
    const Document* document = constUnwrap<Document>();
    return WebAXObject(document->axObjectCache()->objectFromAXID(axID));
}
WebAXObject WebDocument::accessibilityObject() const
{
    const Document* document = constUnwrap<Document>();
    return WebAXObject(document->axObjectCache()->getOrCreate(document->renderer()));
}