Commit 139fb9b5 authored by Zach Helfinstein's avatar Zach Helfinstein Committed by Commit Bot

Fix dictation pref not updating

Bug: 865260
Change-Id: Ied9a9068518cdbc9e05a42cace066c110c0c0e05
Reviewed-on: https://chromium-review.googlesource.com/1147494Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarKatie Dektar <katie@chromium.org>
Commit-Queue: Zach Helfinstein <zhelfins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578476}
parent 9ed6bfad
......@@ -434,19 +434,20 @@ void AccessibilityController::SetDictationEnabled(bool enabled) {
if (enabled && !dialog_ever_accepted) {
Shell::Get()->accelerator_controller()->MaybeShowConfirmationDialog(
IDS_ASH_DICTATION_CONFIRMATION_TITLE,
IDS_ASH_DICTATION_CONFIRMATION_BODY, base::BindOnce([]() {
IDS_ASH_DICTATION_CONFIRMATION_BODY,
// Callback for if the user accepts the dialog
base::BindOnce([]() {
AccessibilityController* controller =
Shell::Get()->accessibility_controller();
controller->SetDictationAcceleratorDialogAccepted();
controller->active_user_prefs_->SetBoolean(
prefs::kAccessibilityDictationEnabled, true);
controller->active_user_prefs_->CommitPendingWrite();
// If they accept, try again to set dictation_enabled to true
controller->SetDictationEnabled(true);
}));
} else {
active_user_prefs_->SetBoolean(prefs::kAccessibilityDictationEnabled,
enabled);
active_user_prefs_->CommitPendingWrite();
return;
}
active_user_prefs_->SetBoolean(prefs::kAccessibilityDictationEnabled,
enabled);
active_user_prefs_->CommitPendingWrite();
}
bool AccessibilityController::IsDictationEnabled() const {
......@@ -827,6 +828,7 @@ void AccessibilityController::ObservePrefs(PrefService* prefs) {
UpdateAutoclickDelayFromPref();
UpdateCaretHighlightFromPref();
UpdateCursorHighlightFromPref();
UpdateDictationFromPref();
UpdateFocusHighlightFromPref();
UpdateHighContrastFromPref();
UpdateLargeCursorFromPref();
......
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