Ejemplo n.º 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());
  }
}
Ejemplo n.º 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();
}
Ejemplo n.º 3
0
void AccessibilityController::reset()
{
    m_rootElement = WebAXObject();
    m_focusedElement = WebAXObject();
    m_elements.clear();
    m_notificationCallbacks.clear();

    m_logAccessibilityEvents = false;
}
Ejemplo n.º 4
0
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));
}
Ejemplo n.º 5
0
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));
}
Ejemplo n.º 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));
 }
Ejemplo n.º 7
0
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());
    }
}
Ejemplo n.º 8
0
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));
}
Ejemplo n.º 9
0
WebAXObject WebDocument::focusedAccessibilityObject() const {
  const Document* document = constUnwrap<Document>();
  AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache());
  return cache ? WebAXObject(cache->focusedObject()) : WebAXObject();
}
Ejemplo n.º 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();
}
Ejemplo n.º 11
0
WebAXObject WebDocument::accessibilityObjectFromID(int axID) const
{
    const Document* document = constUnwrap<Document>();
    return WebAXObject(document->axObjectCache()->objectFromAXID(axID));
}
Ejemplo n.º 12
0
WebAXObject WebDocument::accessibilityObject() const
{
    const Document* document = constUnwrap<Document>();
    return WebAXObject(document->axObjectCache()->getOrCreate(document->renderer()));
}