// Copyright 2016 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ #define COMPONENTS_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ #include <optional> #include <set> #include "base/functional/callback.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/observer_list_types.h" #include "base/time/default_clock.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/keyed_service/core/keyed_service.h" #include "content/public/browser/permission_result.h" #include "url/gurl.h" class GURL; namespace permissions { // Mockable interface for PermissionDecisionAutoBlocker (see below), for those // few instances where this is used outside of permissions and needs separate // unit tests. class PermissionDecisionAutoBlockerBase { … }; // The PermissionDecisionAutoBlocker decides whether or not a given origin // should be automatically blocked from requesting a permission. When an origin // is blocked, it is placed under an "embargo". Until the embargo expires, any // requests made by the origin are automatically blocked. Once the embargo is // lifted, the origin will be permitted to request a permission again, which may // result in it being placed under embargo again. Currently, an origin can be // placed under embargo if it has a number of prior dismissals greater than a // threshold. class PermissionDecisionAutoBlocker : public PermissionDecisionAutoBlockerBase, public KeyedService { … }; } // namespace permissions #endif // COMPONENTS_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_