void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localRoot)
{
    if (m_cursorOverridden)
        return;

#if OS(MACOSX)
    // On Mac the mousemove event propagates to both the popup and main window.
    // If a popup is open we don't want the main window to change the cursor.
    if (m_webView->hasOpenedPopup())
        return;
#endif
    if (!m_webView->client())
        return;
    // TODO(kenrb, dcheng): For top-level frames we still use the WebView as
    // a WebWidget. This special case will be removed when top-level frames
    // get WebFrameWidgets.
    if (localRoot->isMainFrame()) {
        m_webView->client()->didChangeCursor(cursor);
    } else {
        WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
        ASSERT(webFrame);
        ASSERT(webFrame->frameWidget());
        if (toWebFrameWidgetImpl(webFrame->frameWidget())->client())
            toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCursor(cursor);
    }
}
Esempio n. 2
0
void ChromeClientImpl::attachRootLayer(WebLayer* rootLayer,
                                       LocalFrame* localFrame) {
  WebLocalFrameImpl* webFrame =
      WebLocalFrameImpl::fromFrame(localFrame)->localRoot();

  // This method can be called while the frame is being detached. In that
  // case, the rootLayer is null, and the widget is already destroyed.
  DCHECK(webFrame->frameWidget() || !rootLayer);
  if (webFrame->frameWidget())
    webFrame->frameWidget()->setRootLayer(rootLayer);
}
Esempio n. 3
0
void ChromeClientImpl::detachCompositorAnimationTimeline(
    CompositorAnimationTimeline* compositorTimeline,
    LocalFrame* localFrame) {
  WebLocalFrameImpl* webFrame =
      WebLocalFrameImpl::fromFrame(localFrame)->localRoot();

  // This method can be called when the frame is being detached, after the
  // widget is destroyed.
  if (webFrame->frameWidget())
    webFrame->frameWidget()->detachCompositorAnimationTimeline(
        compositorTimeline);
}
Esempio n. 4
0
void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer,
                                               LocalFrame* localFrame) {
  DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
  WebLocalFrameImpl* webFrame =
      WebLocalFrameImpl::fromFrame(localFrame)->localRoot();

  // This method can be called while the frame is being detached. In that
  // case, the rootLayer is null, and the widget is already destroyed.
  DCHECK(webFrame->frameWidget() || !rootLayer);
  if (webFrame->frameWidget())
    webFrame->frameWidget()->setRootGraphicsLayer(rootLayer);
}
Esempio n. 5
0
void ChromeClientImpl::attachCompositorAnimationTimeline(
    CompositorAnimationTimeline* compositorTimeline,
    LocalFrame* localFrame) {
  WebLocalFrameImpl* webFrame =
      WebLocalFrameImpl::fromFrame(localFrame)->localRoot();
  webFrame->frameWidget()->attachCompositorAnimationTimeline(
      compositorTimeline);
}
Esempio n. 6
0
void ChromeClientImpl::setToolTip(LocalFrame& frame,
                                  const String& tooltipText,
                                  TextDirection dir) {
  WebLocalFrameImpl* webFrame =
      WebLocalFrameImpl::fromFrame(&frame)->localRoot();
  if (!tooltipText.isEmpty()) {
    webFrame->frameWidget()->client()->setToolTipText(tooltipText,
                                                      toWebTextDirection(dir));
    m_didRequestNonEmptyToolTip = true;
  } else if (m_didRequestNonEmptyToolTip) {
    // WebWidgetClient::setToolTipText will send an IPC message.  We'd like to
    // reduce the number of setToolTipText calls.
    webFrame->frameWidget()->client()->setToolTipText(tooltipText,
                                                      toWebTextDirection(dir));
    m_didRequestNonEmptyToolTip = false;
  }
}
Esempio n. 7
0
void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput(
    LocalFrame& frame) {
  WebLocalFrameImpl* webFrame =
      WebLocalFrameImpl::fromFrame(frame.localFrameRoot());
  webFrame->frameWidget()
      ->client()
      ->didUpdateTextOfFocusedElementByNonUserInput();
}
void ChromeClientImpl::detachCompositorAnimationTimeline(WebCompositorAnimationTimeline* compositorTimeline, LocalFrame* localRoot)
{
    // FIXME: For top-level frames we still use the WebView as a WebWidget. This special
    // case will be removed when top-level frames get WebFrameWidgets.
    if (localRoot->isMainFrame()) {
        m_webView->detachCompositorAnimationTimeline(compositorTimeline);
    } else {
        WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
        // FIXME: The following conditional is only needed for staging until the Chromium patch
        // lands that instantiates a WebFrameWidget.
        if (!webFrame->frameWidget()) {
            m_webView->detachCompositorAnimationTimeline(compositorTimeline);
            return;
        }
        ASSERT(webFrame && webFrame->frameWidget());
        webFrame->frameWidget()->detachCompositorAnimationTimeline(compositorTimeline);
    }
}
void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFrame* localRoot)
{
    // FIXME: For top-level frames we still use the WebView as a WebWidget. This special
    // case will be removed when top-level frames get WebFrameWidgets.
    if (localRoot->isMainFrame()) {
        m_webView->setRootGraphicsLayer(rootLayer);
    } else {
        WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
        // FIXME: The following conditional is only needed for staging until the Chromium patch
        // lands that instantiates a WebFrameWidget.
        if (!webFrame->frameWidget()) {
            m_webView->setRootGraphicsLayer(rootLayer);
            return;
        }
        ASSERT(webFrame && webFrame->frameWidget());
        webFrame->frameWidget()->setRootGraphicsLayer(rootLayer);
    }
}