Commit d5279786 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update OffTheRecord profile API usage in AccessibilityManager.

Profile API is being updated (issue 1033903) and the usage of
GetOffTheRecordProfile and HasOffTheRecordProfile without argument is
getting deprecated. Use cases of this call that ONLY refer to incognito
or guest mode can use [Get/Has]PrimaryOTRProfile() instead.

Use cases of these functions in AccessibilityManager are updated to use
the new APIs.

This CL does not change any behavior.

Bug: 1060940
Change-Id: I51877f1b5d4e8d520b640ef91134a3291dc59bb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2239845
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777262}
parent 6d1e227b
......@@ -242,8 +242,8 @@ class ChromeVoxDeferredLoader : public content::UtteranceEventDelegate,
void SendWarmupUtterance() {
Profile* profile = manager_->profile();
if (profile->HasOffTheRecordProfile())
profile = profile->GetOffTheRecordProfile();
if (profile->HasPrimaryOTRProfile())
profile = profile->GetPrimaryOTRProfile();
std::unique_ptr<content::TtsUtterance> utterance =
content::TtsUtterance::Create(profile);
utterance->SetEventDelegate(this);
......@@ -255,8 +255,8 @@ class ChromeVoxDeferredLoader : public content::UtteranceEventDelegate,
bool IsGoogleTtsVoiceAvailable() const {
Profile* profile = manager_->profile();
if (profile->HasOffTheRecordProfile())
profile = profile->GetOffTheRecordProfile();
if (profile->HasPrimaryOTRProfile())
profile = profile->GetPrimaryOTRProfile();
std::vector<content::VoiceData> voices;
content::TtsController::GetInstance()->GetVoices(profile, &voices);
return std::any_of(voices.begin(), voices.end(), [](const auto& voice) {
......
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