#include "extensions/renderer/resource_request_policy.h"
#include <string_view>
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/types/optional_util.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/icons_handler.h"
#include "extensions/common/manifest_handlers/web_accessible_resources_info.h"
#include "extensions/common/manifest_handlers/webview_info.h"
#include "extensions/renderer/dispatcher.h"
#include "pdf/buildflags.h"
#include "third_party/blink/public/platform/url_conversion.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/web/web_console_message.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace extensions {
ResourceRequestPolicy::ResourceRequestPolicy(Dispatcher* dispatcher,
std::unique_ptr<Delegate> delegate)
: … { … }
ResourceRequestPolicy::~ResourceRequestPolicy() = default;
void ResourceRequestPolicy::OnExtensionLoaded(const Extension& extension) { … }
bool ResourceRequestPolicy::IsWebAccessibleHost(const std::string& host) { … }
void ResourceRequestPolicy::OnExtensionUnloaded(
const ExtensionId& extension_id) { … }
bool ResourceRequestPolicy::CanRequestResource(
const GURL& upstream_url,
const GURL& target_url,
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const url::Origin* initiator_origin) { … }
}