#include "components/client_hints/browser/client_hints.h"
#include <cmath>
#include <functional>
#include <string>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/json/json_reader.h"
#include "components/client_hints/common/client_hints.h"
#include "components/client_hints/common/switches.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings_constraints.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/embedder_support/user_agent_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "services/network/public/cpp/client_hints.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/common/client_hints/enabled_client_hints.h"
#include "third_party/blink/public/common/features.h"
namespace client_hints {
namespace {
base::flat_map<url::Origin, std::vector<network::mojom::WebClientHintsType>>
ParseInitializeClientHintsStroage() { … }
}
ClientHints::ClientHints(
content::BrowserContext* context,
network::NetworkQualityTracker* network_quality_tracker,
HostContentSettingsMap* settings_map,
scoped_refptr<content_settings::CookieSettings> cookie_settings,
PrefService* pref_service)
: … { … }
ClientHints::~ClientHints() = default;
network::NetworkQualityTracker* ClientHints::GetNetworkQualityTracker() { … }
void ClientHints::GetAllowedClientHintsFromSource(
const url::Origin& origin,
blink::EnabledClientHints* client_hints) { … }
bool ClientHints::IsJavaScriptAllowed(const GURL& url,
content::RenderFrameHost* parent_rfh) { … }
bool ClientHints::AreThirdPartyCookiesBlocked(const GURL& url,
content::RenderFrameHost* rfh) { … }
blink::UserAgentMetadata ClientHints::GetUserAgentMetadata() { … }
void ClientHints::PersistClientHints(
const url::Origin& primary_origin,
content::RenderFrameHost* parent_rfh,
const std::vector<network::mojom::WebClientHintsType>& client_hints) { … }
void ClientHints::SetAdditionalClientHints(
const std::vector<network::mojom::WebClientHintsType>& hints) { … }
void ClientHints::ClearAdditionalClientHints() { … }
void ClientHints::SetMostRecentMainFrameViewportSize(
const gfx::Size& viewport_size) { … }
gfx::Size ClientHints::GetMostRecentMainFrameViewportSize() { … }
void ClientHints::ForceEmptyViewportSizeForTesting(
bool should_force_empty_viewport_size) { … }
bool ClientHints::ShouldForceEmptyViewportSize() { … }
}