Commit a5cb147e authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

Check for Unified Consent feature before enabling Identity Disc

Bug: 965974
Change-Id: I12a8f52e6636035a20b105841f23587d3f68a6fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1625010
Commit-Queue: Peter Lee <pkl@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Auto-Submit: Peter Lee <pkl@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662227}
parent 4d7c149f
......@@ -97,6 +97,7 @@ source_set("feature_flags") {
]
deps = [
"//base",
"//components/unified_consent",
]
}
......
......@@ -13,4 +13,7 @@ extern const base::Feature kUseNSURLSessionForGaiaSigninRequests;
// Feature flag to enable display of current user identity on New Tab Page.
extern const base::Feature kIdentityDisc;
// Whether Identity Disc feature is enabled.
bool IsIdentityDiscFeatureEnabled();
#endif // IOS_CHROME_BROWSER_SIGNIN_FEATURE_FLAGS_H_
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ios/chrome/browser/signin/feature_flags.h"
#include "components/unified_consent/feature.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......@@ -16,3 +17,10 @@ const base::Feature kUseNSURLSessionForGaiaSigninRequests{
const base::Feature kIdentityDisc{"IdentityDisc",
base::FEATURE_DISABLED_BY_DEFAULT};
bool IsIdentityDiscFeatureEnabled() {
// Checks feature flag and any dependencies. Display of Identity Disc depends
// on Unified Consent feature.
return base::FeatureList::IsEnabled(kIdentityDisc) &&
unified_consent::IsUnifiedConsentFeatureEnabled();
}
......@@ -131,7 +131,7 @@ CGFloat IdentityDiscToolbarOffset() {
if (!self.identityDiscView)
return;
DCHECK(base::FeatureList::IsEnabled(kIdentityDisc));
DCHECK(IsIdentityDiscFeatureEnabled());
self.identityDiscTopConstraint.constant = IdentityDiscToolbarOffset();
}
......
......@@ -228,7 +228,7 @@ using base::UserMetricsAction;
self.headerView =
base::mac::ObjCCastStrict<ContentSuggestionsHeaderView>(self.view);
[self addFakeTapView];
if (base::FeatureList::IsEnabled(kIdentityDisc))
if (IsIdentityDiscFeatureEnabled())
[self addIdentityDisc];
[self addFakeOmnibox];
......
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