[cr144][Android] Fixed/got back interstitial page for http warning

Fixed the test HttpsUpgradeBrowserTest.CheckUpgrades.

Fixed interstitial warning when https only is allowed site. STR:
1. Open https://badssl.com/
2. Change Brave Shields settings to `Only connect with HTTPS`
3. Click http button, leads to http://http.badssl.com/
4. Change Brave Shields settings to `Only connect with HTTPS`
5. Go back
6. Click again http button, leads to http://http.badssl.com/
7. Expected to see interstitial page with warning, works so on cr143
7. Actual: just blank page.

Chromium change
https://source.chromium.org/chromium/chromium/src/+/2acf63007e896db6771b218c58a10b592089518f

	[HFM] Enable the new Ask-before-HTTP dialog UI by default

	This makes the new dialog UI the default for users who have HTTPS-First
	Mode enabled on Desktop, replacing the old full page interstitial UI.

	(The Android implementation will use a separate feature flag.)

	Bug: 351990829
	Change-Id: Ib13538bbfc79752ac64c8b956f0bbc28cd872c77
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7173972
This commit is contained in:
AlexeyBarabash
2025-12-21 17:13:23 -05:00
committed by Emerick Rogul
parent 7004ec6c43
commit 16268d4e1f
4 changed files with 27 additions and 0 deletions
+1
View File
@@ -181,6 +181,7 @@ source_set("unit_tests") {
"//android_webview/common",
"//chrome/browser/flags:flags_android",
"//components/password_manager/core/common:features",
"//components/security_interstitials/core",
]
} else {
deps += [
+1
View File
@@ -52,6 +52,7 @@ include_rules += [
"+components/privacy_sandbox/privacy_sandbox_features.h",
"+components/safe_browsing/core/common/features.h",
"+components/search/ntp_features.h",
"+components/security_interstitials/core/features.h",
"+components/segmentation_platform/public/features.h",
"+components/shared_highlighting/core/common/shared_highlighting_features.h",
"+components/signin/public/base/signin_buildflags.h",
+4
View File
@@ -70,6 +70,7 @@
#if BUILDFLAG(IS_ANDROID)
#include "android_webview/common/aw_features.h"
#include "chrome/browser/flags/android/chrome_feature_list.h"
#include "components/security_interstitials/core/features.h"
#else
#include "chrome/browser/sharing_hub/sharing_hub_features.h"
#include "chrome/browser/ui/toasts/toast_features.h"
@@ -236,6 +237,9 @@ TEST(FeatureDefaultsTest, DisabledFeatures) {
&safe_browsing::kClientSideDetectionClipboardCopyApi,
&safe_browsing::kGooglePlayProtectInApkTelemetry,
&safe_browsing::kNotificationTelemetry,
#if BUILDFLAG(IS_ANDROID)
&security_interstitials::features::kHttpsFirstDialogUi,
#endif
&segmentation_platform::features::kSegmentationPlatformDeviceTier,
&segmentation_platform::features::kSegmentationPlatformFeature,
&segmentation_platform::features::kSegmentationPlatformTimeDelaySampling,
@@ -0,0 +1,21 @@
/* Copyright (c) 2025 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "base/feature_override.h"
#include "build/build_config.h"
#include <components/security_interstitials/core/features.cc>
namespace security_interstitials::features {
#if BUILDFLAG(IS_ANDROID)
OVERRIDE_FEATURE_DEFAULT_STATES({{
// Disable dialog UI on Android since Android doesn't have the dialog
// implementation and should use the full-page interstitial instead.
{kHttpsFirstDialogUi, base::FEATURE_DISABLED_BY_DEFAULT},
}});
#endif
} // namespace security_interstitials::features