#include "chrome/browser/ssl/typed_navigation_upgrade_throttle.h"
#include "base/check_op.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "chrome/browser/renderer_host/chrome_navigation_ui_data.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/security_interstitials/core/omnibox_https_upgrade_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "ui/base/page_transition_types.h"
#include "url/url_constants.h"
Event;
kEventHistogram;
namespace {
constexpr base::FeatureParam<base::TimeDelta> kFallbackDelay{ … };
int g_https_port_for_testing = …;
int g_http_port_for_testing = …;
void RecordUMA(Event event) { … }
GURL GetHttpUrl(const GURL& url, int http_fallback_port_for_testing) { … }
}
std::unique_ptr<content::NavigationThrottle>
TypedNavigationUpgradeThrottle::MaybeCreateThrottleFor(
content::NavigationHandle* handle) { … }
bool TypedNavigationUpgradeThrottle::IsNavigationUsingHttpsAsDefaultScheme(
content::NavigationHandle* handle) { … }
TypedNavigationUpgradeThrottle::~TypedNavigationUpgradeThrottle() = default;
content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillStartRequest() { … }
content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillFailRequest() { … }
content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillRedirectRequest() { … }
content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillProcessResponse() { … }
const char* TypedNavigationUpgradeThrottle::GetNameForLogging() { … }
int TypedNavigationUpgradeThrottle::GetHttpsPortForTesting() { … }
void TypedNavigationUpgradeThrottle::SetHttpsPortForTesting(
int https_port_for_testing) { … }
void TypedNavigationUpgradeThrottle::SetHttpPortForTesting(
int http_port_for_testing) { … }
TypedNavigationUpgradeThrottle::TypedNavigationUpgradeThrottle(
content::NavigationHandle* handle)
: … { … }
void TypedNavigationUpgradeThrottle::OnHttpsLoadTimeout() { … }
void TypedNavigationUpgradeThrottle::FallbackToHttp(bool stop_navigation) { … }