Commit 22e7963e authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Implementing unified consent rollback

Implementing unified consent rollback. Related with: crrev.com/c/1165226

Bug: 883089
Change-Id: Id54379e57d79bfd7666f48fba2174ffb18627dc5
Reviewed-on: https://chromium-review.googlesource.com/c/1297970Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602337}
parent 031ae98a
...@@ -49,9 +49,6 @@ UnifiedConsentServiceFactory* UnifiedConsentServiceFactory::GetInstance() { ...@@ -49,9 +49,6 @@ UnifiedConsentServiceFactory* UnifiedConsentServiceFactory::GetInstance() {
std::unique_ptr<KeyedService> std::unique_ptr<KeyedService>
UnifiedConsentServiceFactory::BuildServiceInstanceFor( UnifiedConsentServiceFactory::BuildServiceInstanceFor(
web::BrowserState* context) const { web::BrowserState* context) const {
if (!unified_consent::IsUnifiedConsentFeatureEnabled())
return nullptr;
ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState* browser_state =
ios::ChromeBrowserState::FromBrowserState(context); ios::ChromeBrowserState::FromBrowserState(context);
PrefService* user_pref_service = browser_state->GetPrefs(); PrefService* user_pref_service = browser_state->GetPrefs();
...@@ -59,10 +56,18 @@ UnifiedConsentServiceFactory::BuildServiceInstanceFor( ...@@ -59,10 +56,18 @@ UnifiedConsentServiceFactory::BuildServiceInstanceFor(
std::unique_ptr<unified_consent::UnifiedConsentServiceClient> service_client = std::unique_ptr<unified_consent::UnifiedConsentServiceClient> service_client =
std::make_unique<UnifiedConsentServiceClientImpl>(user_pref_service, std::make_unique<UnifiedConsentServiceClientImpl>(user_pref_service,
local_pref_service); local_pref_service);
identity::IdentityManager* identity_manager = identity::IdentityManager* identity_manager =
IdentityManagerFactory::GetForBrowserState(browser_state); IdentityManagerFactory::GetForBrowserState(browser_state);
syncer::SyncService* sync_service = syncer::SyncService* sync_service =
ProfileSyncServiceFactory::GetForBrowserState(browser_state); ProfileSyncServiceFactory::GetForBrowserState(browser_state);
if (!unified_consent::IsUnifiedConsentFeatureEnabled()) {
unified_consent::UnifiedConsentService::RollbackIfNeeded(
user_pref_service, sync_service, service_client.get());
return nullptr;
}
return std::make_unique<unified_consent::UnifiedConsentService>( return std::make_unique<unified_consent::UnifiedConsentService>(
std::move(service_client), user_pref_service, identity_manager, std::move(service_client), user_pref_service, identity_manager,
sync_service); sync_service);
......
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