summaryrefslogtreecommitdiffstats
path: root/src/core/file_system_access/file_system_access_permission_context_factory_qt.h
blob: 1d98243d6e3816c90b5f8ac14e32e6280fd439a9 (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
// 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 FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_QT_H
#define FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_QT_H

#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"

#include "file_system_access_permission_context_qt.h"

namespace QtWebEngineCore {

class FileSystemAccessPermissionContextFactoryQt : public BrowserContextKeyedServiceFactory
{
public:
    static FileSystemAccessPermissionContextQt *GetForProfile(content::BrowserContext *profile);
    static FileSystemAccessPermissionContextQt *
    GetForProfileIfExists(content::BrowserContext *profile);
    static FileSystemAccessPermissionContextFactoryQt *GetInstance();

private:
    friend struct base::DefaultSingletonTraits<FileSystemAccessPermissionContextFactoryQt>;

    FileSystemAccessPermissionContextFactoryQt();
    ~FileSystemAccessPermissionContextFactoryQt() override;

    // BrowserContextKeyedServiceFactory
    content::BrowserContext *
    GetBrowserContextToUse(content::BrowserContext *context) const override;
    KeyedService *BuildServiceInstanceFor(content::BrowserContext *profile) const override;
    void BrowserContextShutdown(content::BrowserContext *context) override;
};

} // namespace QtWebEngineCore

#endif // FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_QT_H