Commit bccbc7a5 authored by Sergey Poromov's avatar Sergey Poromov Committed by Commit Bot

Disable Drive integration for incognito.

https://crrev.com/c/1926146 introduced a bug that
util::IsDriveEnabledForProfile() might return true for incognito
profiles that are associated with Gaia user that leads to crashes.
Previously such check existed in IsProfileAssociatedWithGaiaAccount()
but was mistakenly treated as redundant.

Bug: 1034621
Change-Id: I041b418f16204db4680645e7cd8a3321da3ebc2d
Tests: Manual.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003852
Auto-Submit: Sergey Poromov <poromov@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732408}
parent d5e1d852
...@@ -85,6 +85,9 @@ bool IsDriveEnabledForProfile(Profile* profile) { ...@@ -85,6 +85,9 @@ bool IsDriveEnabledForProfile(Profile* profile) {
} }
if (!chromeos::LoginState::IsInitialized()) if (!chromeos::LoginState::IsInitialized())
return false; return false;
// Disable Drive for incognito profiles.
if (profile->IsOffTheRecord())
return false;
const user_manager::User* user = const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile); chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
if (!user || !user->HasGaiaAccount()) if (!user || !user->HasGaiaAccount())
......
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