Commit c26968a8 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

ClearBrowsingDataHandler: Do not call into sync_ui_util if guest

sync_ui_util assumes a normal profile, not a guest/incognito profile,
so do not call into it for guest users.

Bug: 911013
Change-Id: I91e3617fdda12e5f228139af6ac93f81f7b79270
Reviewed-on: https://chromium-review.googlesource.com/c/1487887
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636520}
parent ea69e002
...@@ -246,11 +246,15 @@ void ClearBrowsingDataHandler::HandleClearBrowsingData( ...@@ -246,11 +246,15 @@ void ClearBrowsingDataHandler::HandleClearBrowsingData(
checked_other_types); checked_other_types);
} }
// If Sync is running, prevent it from being paused during the operation.
// However, if Sync is in error, clearing cookies should pause it.
std::unique_ptr<AccountReconcilor::ScopedSyncedDataDeletion> std::unique_ptr<AccountReconcilor::ScopedSyncedDataDeletion>
scoped_data_deletion; scoped_data_deletion;
if (sync_ui_util::GetStatus(profile_) == sync_ui_util::SYNCED) {
// If Sync is running, prevent it from being paused during the operation.
// However, if Sync is in error, clearing cookies should pause it.
if (!profile_->IsGuestSession() &&
sync_ui_util::GetStatus(profile_) == sync_ui_util::SYNCED) {
// Settings can not be opened in incognito windows.
DCHECK(!profile_->IsOffTheRecord());
scoped_data_deletion = AccountReconcilorFactory::GetForProfile(profile_) scoped_data_deletion = AccountReconcilorFactory::GetForProfile(profile_)
->GetScopedSyncDataDeletion(); ->GetScopedSyncDataDeletion();
} }
......
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