Commit 979cc8d6 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

Migrate DownloadProtectionService to the IdentityManager

Replace instance of SigninManagerBase with one of IdentityManager
and update calls accordingly.

Bug: 889882
Change-Id: I4e76d223a1b8a6bc328cb97e1624d2c4d7532fae
Reviewed-on: https://chromium-review.googlesource.com/1251532Reviewed-by: default avatarJialiu Lin <jialiul@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#595133}
parent f663354d
......@@ -18,12 +18,11 @@
#include "chrome/browser/safe_browsing/download_protection/download_url_sb_client.h"
#include "chrome/browser/safe_browsing/download_protection/ppapi_download_request.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/common/safe_browsing/binary_feature_extractor.h"
#include "chrome/common/url_constants.h"
#include "components/google/core/common/google_util.h"
#include "components/safe_browsing/common/safebrowsing_switches.h"
#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
......@@ -31,6 +30,7 @@
#include "content/public/browser/web_contents.h"
#include "net/base/url_util.h"
#include "net/cert/x509_util.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
using content::BrowserThread;
......@@ -493,11 +493,11 @@ void DownloadProtectionService::AddReferrerChainToPPAPIClientDownloadRequest(
void DownloadProtectionService::OnDangerousDownloadOpened(
const download::DownloadItem* item,
Profile* profile) {
const SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfileIfExists(profile);
std::string username =
signin_manager ? signin_manager->GetAuthenticatedAccountInfo().email
: std::string();
identity::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfileIfExists(profile);
std::string username = identity_manager
? identity_manager->GetPrimaryAccountInfo().email
: std::string();
std::string raw_digest_sha256 = item->GetHash();
extensions::SafeBrowsingPrivateEventRouterFactory::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