Molybden API
Loading...
Searching...
No Matches
permissions.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_PERMISSIONS_HPP
6#define MOLYBDEN_PERMISSIONS_HPP
7
8#include <memory>
9
10#include "molybden/permission/permissions_delegates.hpp"
11
12namespace molybden {
13
14class Profile;
15
19enum class PermissionType {
20 kUnspecified,
21 kNotifications,
22 kGeolocation,
23 kAudioCapture,
24 kVideoCapture,
28 kClipboardReadWrite,
29 kProtectedMediaIdentifier,
30 kMidi,
31 kMidiSysex,
32 kDurableStorage,
33 kBackgroundSync,
38 kSensors,
45 kAccessibilityEvents,
46 kClipboardSanitizedWrite,
51 kLocalFonts
52};
53
57enum class PermissionStatus { kGranted, kDenied, kAsk };
58
67 public:
71 virtual std::shared_ptr<Profile> profile() = 0;
72
76 virtual PermissionStatus getPermissionStatus(PermissionType permission_type,
77 const std::string& url) = 0;
78
82 virtual void resetPermission(PermissionType permission_type,
83 const std::string& url) = 0;
84};
85} // namespace molybden
86
87#endif // MOLYBDEN_PERMISSIONS_HPP
A class that contains all permission delegates.
Definition permissions_delegates.hpp:71
Allows managing permissions for secure web pages.
Definition permissions.hpp:66
virtual std::shared_ptr< Profile > profile()=0
The profile of this service.
virtual void resetPermission(PermissionType permission_type, const std::string &url)=0
Sets the permission back to its default for the given URL.
virtual PermissionStatus getPermissionStatus(PermissionType permission_type, const std::string &url)=0
Returns the permission status for the given URL.