Chromium changes: https://chromium.googlesource.com/chromium/src/+/5bb74b89d4749927ce8f2e10a04d99903bba677c commit 5bb74b89d4749927ce8f2e10a04d99903bba677c Author: Chris Thompson <cthomp@chromium.org> Date: Wed Aug 6 15:01:47 2025 -0700 [HFM] Add new Ask-before-HTTP dialog UI This adds AskBeforeHttpDialogController which is responsible for defining the dialog model, owning the resulting dialog widget, and tracking dialog events for a new "Ask-before-HTTP" warning dialog. The controller itself is owned by the TabFeatures class and is instantiated on a per-tab basis. The actual dialog itself is created using a DialogModel, hosted in a BubbleDialogModelHost, and presented via TabDialogManager. As part of this effort, this CL refactors out some shared logic ( ComputeInterstitialState()) and exposes some other logic for reuse (such as GetInterstitialReason()) so they can be reused across the two UIs. A new interactive UI test suite is added to explicitly test the dialog UI and the different actions there-in. This intentionally somewhat overlaps with the existing browser tests in https_upgrades_browsertest.cc (which focuses more on the underlying HTTPS-Upgrades/fallback and navigation handling logic). See crbug.com/351990829#comment3 and crbug.com/351990829#comment3 for a recording and screenshot of how the new dialog UI looks. DanglingUntriaged-notes: Duplicate of existing test suite use Bug: 351990829 Change-Id: I7be11a749dd2e08cda362d5adca7b1e85ba792e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6817235 Reviewed-by: David Pennington <dpenning@chromium.org> Reviewed-by: Joe DeBlasio <jdeblasio@chromium.org> Reviewed-by: Mustafa Emre Acer <meacer@chromium.org> Commit-Queue: Chris Thompson <cthomp@chromium.org> Cr-Commit-Position: refs/heads/main@{#1497873}
19 lines
1.0 KiB
Diff
19 lines
1.0 KiB
Diff
diff --git a/chrome/browser/ssl/https_upgrades_util.cc b/chrome/browser/ssl/https_upgrades_util.cc
|
|
index f03fb1f966d8616f58ff643f5eec70d8f5b2c673..3664337249582a1bcac42b1457b9777c1b49f773 100644
|
|
--- a/chrome/browser/ssl/https_upgrades_util.cc
|
|
+++ b/chrome/browser/ssl/https_upgrades_util.cc
|
|
@@ -72,11 +72,11 @@ ComputeInterstitialState(content::WebContents* web_contents, const GURL& url) {
|
|
security_interstitials::https_only_mode::HttpInterstitialState
|
|
interstitial_state;
|
|
interstitial_state.enabled_by_pref =
|
|
- prefs && prefs->GetBoolean(prefs::kHttpsOnlyModeEnabled);
|
|
+ prefs && prefs->GetBooleanOr(prefs::kHttpsOnlyModeEnabled, NormalWindowHttpsOnly(url, profile));
|
|
|
|
if (base::FeatureList::IsEnabled(features::kHttpsFirstModeIncognito)) {
|
|
if (profile->IsIncognitoProfile() && prefs &&
|
|
- prefs->GetBoolean(prefs::kHttpsFirstModeIncognito)) {
|
|
+ prefs->GetBooleanOr(prefs::kHttpsFirstModeIncognito, NormalWindowHttpsOnly(url, profile))) {
|
|
interstitial_state.enabled_by_incognito = true;
|
|
}
|
|
}
|