Commit 5e82a201 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

[ios] Migrate AutocompleteProviderClientImpl to the IdentityManager

Use call to IdentityManager::HasPrimaryAccount() instead of the former
SigninManagerBase::IsAuthenticated(), and remove unnecessary includes.

Bug: 890816
Change-Id: I7d5d0f6a078c1065984cabcc071efd3fc02ed92d
Reviewed-on: https://chromium-review.googlesource.com/c/1314472Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#605781}
parent 6d8e408d
...@@ -41,6 +41,7 @@ source_set("autocomplete") { ...@@ -41,6 +41,7 @@ source_set("autocomplete") {
"//ios/chrome/browser/web_state_list", "//ios/chrome/browser/web_state_list",
"//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser",
"//ios/web", "//ios/web",
"//services/identity/public/cpp",
"//url", "//url",
] ]
} }
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/core/service_access_type.h"
#include "components/omnibox/browser/autocomplete_classifier.h" #include "components/omnibox/browser/autocomplete_classifier.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "components/unified_consent/unified_consent_service.h" #include "components/unified_consent/unified_consent_service.h"
#include "components/unified_consent/url_keyed_data_collection_consent_helper.h" #include "components/unified_consent/url_keyed_data_collection_consent_helper.h"
...@@ -26,13 +25,14 @@ ...@@ -26,13 +25,14 @@
#include "ios/chrome/browser/history/top_sites_factory.h" #include "ios/chrome/browser/history/top_sites_factory.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
#include "ios/chrome/browser/search_engines/template_url_service_factory.h" #include "ios/chrome/browser/search_engines/template_url_service_factory.h"
#include "ios/chrome/browser/signin/signin_manager_factory.h" #include "ios/chrome/browser/signin/identity_manager_factory.h"
#include "ios/chrome/browser/sync/profile_sync_service_factory.h" #include "ios/chrome/browser/sync/profile_sync_service_factory.h"
#import "ios/chrome/browser/tabs/tab_model.h" #import "ios/chrome/browser/tabs/tab_model.h"
#import "ios/chrome/browser/tabs/tab_model_list.h" #import "ios/chrome/browser/tabs/tab_model_list.h"
#include "ios/chrome/browser/unified_consent/unified_consent_service_factory.h" #include "ios/chrome/browser/unified_consent/unified_consent_service_factory.h"
#import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list.h"
#import "ios/web/public/web_state/web_state.h" #import "ios/web/public/web_state/web_state.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -180,9 +180,9 @@ bool AutocompleteProviderClientImpl::IsPersonalizedUrlDataCollectionActive() ...@@ -180,9 +180,9 @@ bool AutocompleteProviderClientImpl::IsPersonalizedUrlDataCollectionActive()
} }
bool AutocompleteProviderClientImpl::IsAuthenticated() const { bool AutocompleteProviderClientImpl::IsAuthenticated() const {
SigninManagerBase* signin_manager = identity::IdentityManager* identity_manager =
ios::SigninManagerFactory::GetForBrowserState(browser_state_); IdentityManagerFactory::GetForBrowserState(browser_state_);
return signin_manager != nullptr && signin_manager->IsAuthenticated(); return identity_manager != nullptr && identity_manager->HasPrimaryAccount();
} }
bool AutocompleteProviderClientImpl::IsUnifiedConsentGiven() const { bool AutocompleteProviderClientImpl::IsUnifiedConsentGiven() const {
......
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