chromium/third_party/blink/public/common/navigation/navigation_policy.h

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

#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_NAVIGATION_NAVIGATION_POLICY_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_NAVIGATION_NAVIGATION_POLICY_H_

#include <bitset>

#include "third_party/blink/public/common/common_export.h"
#include "third_party/blink/public/common/navigation/resource_intercept_policy.h"
#include "third_party/blink/public/mojom/navigation/navigation_initiator_activation_and_ad_status.mojom.h"

// A centralized file for base helper methods and policy decisions about
// navigations.

namespace blink {
// Navigation type that affects the download decision at download-discovery
// time.
enum class NavigationDownloadType {};

// Stores the navigation types that may be of interest to the download-related
// metrics to be reported at download-discovery time. Also controls how
// navigations behave when they turn into downloads. By default, navigation is
// allowed to become a download.
struct BLINK_COMMON_EXPORT NavigationDownloadPolicy {};

// Construct a `NavigationInitiatorActivationAndAdStatus` based on the user
// activation and ad status.
BLINK_COMMON_EXPORT
blink::mojom::NavigationInitiatorActivationAndAdStatus
GetNavigationInitiatorActivationAndAdStatus(bool has_user_activation,
                                            bool initiator_frame_is_ad,
                                            bool is_ad_script_in_stack);

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_COMMON_NAVIGATION_NAVIGATION_POLICY_H_