Commit 7e98333b authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Chromium LUCI CQ

[iOS][Getaway] Respect the enterprise policy to disable Incognito mode.

Hides the setting when the policy is enabled. No need to do anything
else, since when there's no Incognito mode, there's nothing to protect,
and without any incognito tabs all other code is no-op.

Bug: none
Change-Id: Iaeb94ab9f9d78a09096d0bbf611a992a19df28b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617882Reviewed-by: default avatarNohemi Fernandez <fernandex@chromium.org>
Reviewed-by: default avatarTina Wang <tinazwang@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842544}
parent 79e6e2e5
...@@ -24,6 +24,7 @@ source_set("privacy_ui") { ...@@ -24,6 +24,7 @@ source_set("privacy_ui") {
"//ios/chrome/browser/browser_state", "//ios/chrome/browser/browser_state",
"//ios/chrome/browser/browsing_data:feature_flags", "//ios/chrome/browser/browsing_data:feature_flags",
"//ios/chrome/browser/main:public", "//ios/chrome/browser/main:public",
"//ios/chrome/browser/prefs:browser_prefs",
"//ios/chrome/browser/ui:feature_flags", "//ios/chrome/browser/ui:feature_flags",
"//ios/chrome/browser/ui/colors", "//ios/chrome/browser/ui/colors",
"//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/commands",
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "ios/chrome/browser/browsing_data/browsing_data_features.h" #include "ios/chrome/browser/browsing_data/browsing_data_features.h"
#import "ios/chrome/browser/main/browser.h" #import "ios/chrome/browser/main/browser.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
#import "ios/chrome/browser/prefs/prefs_util.h"
#import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
...@@ -167,7 +168,10 @@ const char kGoogleServicesSettingsURL[] = "settings://open_google_services"; ...@@ -167,7 +168,10 @@ const char kGoogleServicesSettingsURL[] = "settings://open_google_services";
[model addItem:[self handoffDetailItem] [model addItem:[self handoffDetailItem]
toSectionWithIdentifier:SectionIdentifierWebServices]; toSectionWithIdentifier:SectionIdentifierWebServices];
if (base::FeatureList::IsEnabled(kIncognitoAuthentication)) { // Do not show the incognito authentication setting when Incongito mode is
// disabled.
if (base::FeatureList::IsEnabled(kIncognitoAuthentication) &&
!IsIncognitoModeDisabled(_browserState->GetPrefs())) {
// Incognito authentication item. // Incognito authentication item.
[model addItem:self.incognitoReauthItem [model addItem:self.incognitoReauthItem
toSectionWithIdentifier:SectionIdentifierIncognitoAuth]; toSectionWithIdentifier:SectionIdentifierIncognitoAuth];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment