Commit 2816cc86 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Check that mirror or dice is enabled to add observer

The identity manager creates a browser crash if AddObserver is called
in incognito. Check that either mirror or dice is enabled before
getting the manager and adding the observer.

Bug: 968084
Change-Id: I4017eeada1732172cd7a731b64e9d8d1f69cf9a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635634Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664397}
parent ce81771c
......@@ -1327,6 +1327,11 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() {
return;
Profile* profile = Profile::FromWebUI(web_ui());
if (!AccountConsistencyModeManager::IsMirrorEnabledForProfile(profile) &&
!AccountConsistencyModeManager::IsDiceEnabledForProfile(profile)) {
return;
}
identity_manager_ = IdentityManagerFactory::GetForProfile(profile);
identity_manager_->AddObserver(this);
}
......
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