Commit 7b528f41 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

Convert browsing_data_counter_utils.cc to use IdentityManager

Migrate from using ProfileOAuth2TokenService and SigninManager to using
the IdentityManager instead, and remove the related includes.

Bug: 882862
Change-Id: I5fb46927ffba508e6987f615ed22bc1a90155607
Reviewed-on: https://chromium-review.googlesource.com/c/1255624Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#597519}
parent b2965f70
...@@ -11,15 +11,14 @@ ...@@ -11,15 +11,14 @@
#include "chrome/browser/browsing_data/counters/signin_data_counter.h" #include "chrome/browser/browsing_data/counters/signin_data_counter.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h" #include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/browsing_data/core/pref_names.h" #include "components/browsing_data/core/pref_names.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/text/bytes_formatting.h" #include "ui/base/text/bytes_formatting.h"
...@@ -48,11 +47,13 @@ base::string16 FormatBytesMBOrHigher( ...@@ -48,11 +47,13 @@ base::string16 FormatBytesMBOrHigher(
bool ShouldShowCookieException(Profile* profile) { bool ShouldShowCookieException(Profile* profile) {
if (AccountConsistencyModeManager::IsMirrorEnabledForProfile(profile)) { if (AccountConsistencyModeManager::IsMirrorEnabledForProfile(profile)) {
auto* signin_manager = SigninManagerFactory::GetForProfile(profile); auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
return signin_manager->IsAuthenticated(); return identity_manager->HasPrimaryAccount();
} }
#if BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT)
if (AccountConsistencyModeManager::IsDiceEnabledForProfile(profile)) { if (AccountConsistencyModeManager::IsDiceEnabledForProfile(profile)) {
// TODO(http://crbug.com/890796): Migrate this part once sync_ui_util has
// been migrated to the IdentityManager.
sync_ui_util::MessageType sync_status = sync_ui_util::GetStatus( sync_ui_util::MessageType sync_status = sync_ui_util::GetStatus(
profile, ProfileSyncServiceFactory::GetForProfile(profile), profile, ProfileSyncServiceFactory::GetForProfile(profile),
*SigninManagerFactory::GetForProfile(profile)); *SigninManagerFactory::GetForProfile(profile));
......
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