Skip to content

Commit

Permalink
HTTPS-Only Mode: Enable the UI setting by default
Browse files Browse the repository at this point in the history
The HTTPS-Only Mode feature has a UI toggle that's only displayed if
the user enables "https-only-mode" feature flag in chrome://flags.

This CL enables the feature flag by default which in turn shows the
UI setting. It doesn't enable the HTTPS-Only Mode feature on its own.

Bug: 1302509, 1340082
Change-Id: Ib6c856494d9a41b4cf5e5599bd44c4fe09889a4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3723913
Commit-Queue: Mustafa Emre Acer <[email protected]>
Reviewed-by: Chris Thompson <[email protected]>
Reviewed-by: Sergio Collazos <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1018470}
  • Loading branch information
meacer authored and Chromium LUCI CQ committed Jun 27, 2022
1 parent 0d729fc commit 6e54787
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions ios/chrome/browser/ui/settings/privacy/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ source_set("unit_tests") {
"//ios/chrome/browser/ui/table_view:utils",
"//ios/chrome/browser/ui/table_view/cells",
"//ios/chrome/test:test_support",
"//ios/components/security_interstitials/https_only_mode:feature",
"//ios/web/public/test",
"//testing/gtest",
"//third_party/ocmock:ocmock",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ios/chrome/test/ios_chrome_scoped_testing_local_state.h"
#import "ios/components/security_interstitials/https_only_mode/feature.h"
#include "ios/web/public/test/web_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
Expand Down Expand Up @@ -63,6 +64,8 @@ typedef NS_ENUM(NSUInteger, PrivacyTableViewControllerTestConfig) {
PrivacyTableViewControllerTestConfigEnhancedProtectionEnabled = 1 << 0,
// Tests should run with Third-party intents in Incognito flag enabled.
PrivacyTableViewControllerTestConfig3PIntentsInIncognitoEnabled = 1 << 1,
// Tests should run with HTTPS-Only Mode flag enabled.
PrivacyTableViewControllerTestConfigHttpsOnlyModeSettingEnabled = 1 << 2,
};

// `ScopedFeatureList` wrapper so `PrivacyTableViewControllerTest` can ensure
Expand Down Expand Up @@ -110,6 +113,15 @@ typedef NS_ENUM(NSUInteger, PrivacyTableViewControllerTestConfig) {
enabledDisabledFeatures.second.push_back(kIOS3PIntentsInIncognito);
}

if (GetParam() &
PrivacyTableViewControllerTestConfigHttpsOnlyModeSettingEnabled) {
enabledDisabledFeatures.first.push_back(
security_interstitials::features::kHttpsOnlyMode);
} else {
enabledDisabledFeatures.second.push_back(
security_interstitials::features::kHttpsOnlyMode);
}

return enabledDisabledFeatures;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace security_interstitials {
namespace features {

const base::Feature kHttpsOnlyMode{"HttpsOnlyMode",
base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_ENABLED_BY_DEFAULT};

} // namespace features
} // namespace security_interstitials
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
namespace security_interstitials {
namespace features {

// Enables HTTPS-Only mode upgrades on iOS.
// Enables the HTTPS-Only mode UI setting on iOS. The user has to enable
// the UI setting under "Privacy and Security" to use HTTPS-Only Mode.
extern const base::Feature kHttpsOnlyMode;

} // namespace features
Expand Down

0 comments on commit 6e54787

Please sign in to comment.