chromium/content/browser/permissions/embedded_permission_control_checker.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_PERMISSIONS_EMBEDDED_PERMISSION_CONTROL_CHECKER_H_
#define CONTENT_BROWSER_PERMISSIONS_EMBEDDED_PERMISSION_CONTROL_CHECKER_H_

#include <map>
#include <memory>
#include <set>

#include "base/containers/circular_deque.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "content/common/content_export.h"
#include "content/public/browser/page.h"
#include "content/public/browser/page_user_data.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/permissions/permission.mojom.h"

namespace content {

// This class provides utility functions to determine if a page embedded
// permission control (PEPC) is allowed to be inserted to a page, based on the
// situation and policy. If this checker returns no, the corresponding
// permission element is not expected to be rendered on the page. For example,
// there will be at most a limited instance of PEPC for the current page at any
// time, and registering a new one will automatically denied.
class CONTENT_EXPORT EmbeddedPermissionControlChecker
    : public content::PageUserData<EmbeddedPermissionControlChecker> {};

}  // namespace content

#endif  // CONTENT_BROWSER_PERMISSIONS_EMBEDDED_PERMISSION_CONTROL_CHECKER_H_