summaryrefslogtreecommitdiffstats
path: root/src/core/printing/pdf_web_contents_helper_client_qt.h
blob: 10df8a7468b3fff3b2d30b793b457e86f13c8921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H
#define PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H

#include "components/pdf/browser/pdf_web_contents_helper_client.h"

// based on chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h:
class PDFWebContentsHelperClientQt : public pdf::PDFWebContentsHelperClient
{
public:
    PDFWebContentsHelperClientQt();
    PDFWebContentsHelperClientQt(const PDFWebContentsHelperClientQt&) = delete;
    PDFWebContentsHelperClientQt& operator=(const PDFWebContentsHelperClientQt&) = delete;
    ~PDFWebContentsHelperClientQt() override;

private:
    // pdf::PDFWebContentsHelperClient:
    content::RenderFrameHost* FindPdfFrame(content::WebContents *contents) override;
    void OnPDFHasUnsupportedFeature(content::WebContents *contents) override {}
    void OnSaveURL(content::WebContents *contents) override {}
    void SetPluginCanSave(content::RenderFrameHost *render_frame_host, bool can_save) override;
    void UpdateContentRestrictions(content::RenderFrameHost *, int) override;
};

#endif // PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H