summaryrefslogtreecommitdiffstats
path: root/src/core/net/webui_controller_factory_qt.h
blob: 22219dd5a4cdf6bf1b8e23f64a46ee0acb1382a4 (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
// Copyright (C) 2017 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 WEB_UI_CONTROLLER_FACTORY_QT_H_
#define WEB_UI_CONTROLLER_FACTORY_QT_H_

#include "base/memory/singleton.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_controller_factory.h"

namespace QtWebEngineCore {

class WebUIControllerFactoryQt : public content::WebUIControllerFactory
{
public:
    content::WebUI::TypeID GetWebUIType(content::BrowserContext *browserContext, const GURL &url) override;
    bool UseWebUIForURL(content::BrowserContext *browserContext, const GURL &url) override;
    std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(content::WebUI *webUi, const GURL &url) override;

    static WebUIControllerFactoryQt *GetInstance();

protected:
    WebUIControllerFactoryQt();
    ~WebUIControllerFactoryQt() override;

private:
    friend struct base::DefaultSingletonTraits<WebUIControllerFactoryQt>;
};

} // namespace QtWebEngineCore

#endif // WEB_UI_CONTROLLER_FACTORY_QT_H_