summaryrefslogtreecommitdiffstats
path: root/src/core/custom_handlers/protocol_handler_registry_delegate_qt.h
blob: 6a0753d22d4964c376c95594555aa7709750b6c7 (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
// 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

// based on chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.h:
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PROTOCOL_HANDLER_REGISTRY_DELEGATE_QT_H_
#define PROTOCOL_HANDLER_REGISTRY_DELEGATE_QT_H_

#include <string>

#include "components/custom_handlers/protocol_handler_registry.h"

namespace QtWebEngineCore {

// This class implements the ProtocolHandlerRegistry::Delegate
// abstract class to provide an OS dependent implementation
class ProtocolHandlerRegistryDelegateQt : public custom_handlers::ProtocolHandlerRegistry::Delegate {
public:
    ProtocolHandlerRegistryDelegateQt();
    ~ProtocolHandlerRegistryDelegateQt() override;

    ProtocolHandlerRegistryDelegateQt(const ProtocolHandlerRegistryDelegateQt &other) = delete;
    ProtocolHandlerRegistryDelegateQt &operator=(const ProtocolHandlerRegistryDelegateQt &other) = delete;

    // ProtocolHandlerRegistry::Delegate:
    void RegisterExternalHandler(const std::string &protocol) override;
    bool IsExternalHandlerRegistered(const std::string &protocol) override;
};

} // namespace QtWebEngineCore

#endif  // PROTOCOL_HANDLER_REGISTRY_DELEGATE_QT_H_