summaryrefslogtreecommitdiffstats
path: root/src/core/custom_handlers/register_protocol_handler_request_controller_impl.h
blob: feb2cf0b8270f80a69a1602d1105cca748bf1a6d (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
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2018 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 REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
#define REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H

#include "custom_handlers/register_protocol_handler_request_controller.h"

#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/custom_handlers/protocol_handler.h"

namespace custom_handlers {
class ProtocolHandlerRegistry;
}

namespace QtWebEngineCore {

class RegisterProtocolHandlerRequestControllerImpl final : public RegisterProtocolHandlerRequestController,
                                                           private content::WebContentsObserver {
public:
    RegisterProtocolHandlerRequestControllerImpl(
        content::WebContents *webContents,
        content::ProtocolHandler handler);

    ~RegisterProtocolHandlerRequestControllerImpl();

protected:
    void accepted() override;
    void rejected() override;

private:
    custom_handlers::ProtocolHandlerRegistry *protocolHandlerRegistry();
    content::ProtocolHandler m_handler;
};

} // namespace QtWebEngineCore

#endif // REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H