electron_pdf_web_contents_helper_client.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2015 Slack Technologies, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "shell/browser/electron_pdf_web_contents_helper_client.h"
  5. #include "chrome/browser/pdf/pdf_frame_util.h"
  6. #include "content/public/browser/web_contents.h"
  7. ElectronPDFWebContentsHelperClient::ElectronPDFWebContentsHelperClient() =
  8. default;
  9. ElectronPDFWebContentsHelperClient::~ElectronPDFWebContentsHelperClient() =
  10. default;
  11. content::RenderFrameHost* ElectronPDFWebContentsHelperClient::FindPdfFrame(
  12. content::WebContents* contents) {
  13. content::RenderFrameHost* main_frame = contents->GetPrimaryMainFrame();
  14. content::RenderFrameHost* pdf_frame =
  15. pdf_frame_util::FindPdfChildFrame(main_frame);
  16. return pdf_frame ? pdf_frame : main_frame;
  17. }
  18. void ElectronPDFWebContentsHelperClient::UpdateContentRestrictions(
  19. content::RenderFrameHost* render_frame_host,
  20. int content_restrictions) {}
  21. void ElectronPDFWebContentsHelperClient::OnPDFHasUnsupportedFeature(
  22. content::WebContents* contents) {}
  23. void ElectronPDFWebContentsHelperClient::OnSaveURL(
  24. content::WebContents* contents) {}
  25. void ElectronPDFWebContentsHelperClient::SetPluginCanSave(
  26. content::RenderFrameHost* render_frame_host,
  27. bool can_save) {}