#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
#include <string_view>
#include <tuple>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/permissions/permission_message_util.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/url_pattern.h"
#include "extensions/common/url_pattern_set.h"
#include "url/gurl.h"
APIPermissionID;
namespace extensions {
namespace {
class ComparablePermission { … };
ComparablePermissions;
}
PermissionMsgSet;
ChromePermissionMessageProvider::ChromePermissionMessageProvider() { … }
ChromePermissionMessageProvider::~ChromePermissionMessageProvider() { … }
PermissionMessages ChromePermissionMessageProvider::GetPermissionMessages(
const PermissionIDSet& permissions) const { … }
bool ChromePermissionMessageProvider::IsPrivilegeIncrease(
const PermissionSet& granted_permissions,
const PermissionSet& requested_permissions,
Manifest::Type extension_type) const { … }
PermissionIDSet ChromePermissionMessageProvider::GetAllPermissionIDs(
const PermissionSet& permissions,
Manifest::Type extension_type) const { … }
PermissionIDSet ChromePermissionMessageProvider::GetManagementUIPermissionIDs(
const PermissionSet& permissions,
Manifest::Type extension_type) const { … }
void ChromePermissionMessageProvider::AddAPIPermissionsForManagementUIWarning(
const PermissionSet& permissions,
PermissionIDSet* permission_ids) const { … }
void ChromePermissionMessageProvider::
AddManifestPermissionsForManagementUIWarning(
const PermissionSet& permissions,
PermissionIDSet* permission_ids) const { … }
void ChromePermissionMessageProvider::AddAPIPermissions(
const PermissionSet& permissions,
PermissionIDSet* permission_ids) const { … }
void ChromePermissionMessageProvider::AddManifestPermissions(
const PermissionSet& permissions,
PermissionIDSet* permission_ids) const { … }
void ChromePermissionMessageProvider::AddHostPermissions(
const PermissionSet& permissions,
PermissionIDSet* permission_ids,
Manifest::Type extension_type) const { … }
bool ChromePermissionMessageProvider::IsAPIOrManifestPrivilegeIncrease(
const PermissionSet& granted_permissions,
const PermissionSet& requested_permissions) const { … }
bool ChromePermissionMessageProvider::IsHostPrivilegeIncrease(
const PermissionSet& granted_permissions,
const PermissionSet& requested_permissions,
Manifest::Type extension_type) const { … }
PermissionMessages ChromePermissionMessageProvider::GetPermissionMessagesHelper(
const PermissionIDSet& permissions,
const std::vector<ChromePermissionMessageRule>& rules) const { … }
}