libcef/renderer/extensions/print_render_frame_helper_delegate.cc
// Return the PDF object element if |frame| is the out of process PDF extension.
Return the PDF object element if |frame| is the out of process PDF extension.
Return the PDF object element if |frame| is the out of process PDF extension .
blink::WebElement CefPrintRenderFrameHelperDelegate::GetPdfElement(
    blink::WebLocalFrame* frame) {
  if (IsPdfInternalPluginAllowedOrigin(frame->GetSecurityOrigin())) {
    DCHECK(!base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned));
    auto viewer_element = frame->GetDocument().GetElementById("viewer");
    if (!viewer_element.IsNull() && !viewer_element.ShadowRoot().IsNull()) {
      auto plugin_element =
          viewer_element.ShadowRoot().QuerySelector("#plugin");
      if (!plugin_element.IsNull()) {
        return plugin_element;
      }
    }
    NOTREACHED();
    return blink::WebElement();
  }
  if (frame->Parent() &&
      IsPdfInternalPluginAllowedOrigin(frame->Parent()->GetSecurityOrigin())) {
    DCHECK(base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned));
    auto plugin_element = frame->GetDocument().QuerySelector("embed");
    DCHECK(!plugin_element.IsNull());
    return plugin_element;
  }
  return blink::WebElement();
}
blink :: WebElement CefPrintRenderFrameHelperDelegate :: GetPdfElement ( blink :: WebLocalFrame * frame ) { if ( IsPdfInternalPluginAllowedOrigin ( frame -> GetSecurityOrigin ( ) ) ) { DCHECK ( ! base :: FeatureList :: IsEnabled ( chrome_pdf :: features :: kPdfUnseasoned ) ) ; auto viewer_element = frame -> GetDocument ( ) . GetElementById ( " " ) ; if ( ! viewer_element . IsNull ( ) && ! viewer_element . ShadowRoot ( ) . IsNull ( ) ) { auto plugin_element = viewer_element . ShadowRoot ( ) . QuerySelector ( " " ) ; if ( ! plugin_element . IsNull ( ) ) { return plugin_element ; } } NOTREACHED ( ) ; return blink :: WebElement ( ) ; } if ( frame -> Parent ( ) && IsPdfInternalPluginAllowedOrigin ( frame -> Parent ( ) -> GetSecurityOrigin ( ) ) ) { DCHECK ( base :: FeatureList :: IsEnabled ( chrome_pdf :: features :: kPdfUnseasoned ) ) ; auto plugin_element = frame -> GetDocument ( ) . QuerySelector ( " " ) ; DCHECK ( ! plugin_element . IsNull ( ) ) ; return plugin_element ; } return blink :: WebElement ( ) ; }
Return the PDF object element if |frame| is the out of process PDF extension.
Return the PDF object element if |frame| is the out of process PDF extension .
// <object> with id="plugin" is created in // chrome/browser/resources/pdf/pdf_viewer_base.js.