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) { ...@@ -434,19 +434,20 @@ void AccessibilityController::SetDictationEnabled(bool enabled) {
if (enabled && !dialog_ever_accepted) { if (enabled && !dialog_ever_accepted) {
Shell::Get()->accelerator_controller()->MaybeShowConfirmationDialog( Shell::Get()->accelerator_controller()->MaybeShowConfirmationDialog(
IDS_ASH_DICTATION_CONFIRMATION_TITLE, 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 = AccessibilityController* controller =
Shell::Get()->accessibility_controller(); Shell::Get()->accessibility_controller();
controller->SetDictationAcceleratorDialogAccepted(); controller->SetDictationAcceleratorDialogAccepted();
controller->active_user_prefs_->SetBoolean( // If they accept, try again to set dictation_enabled to true
prefs::kAccessibilityDictationEnabled, true); controller->SetDictationEnabled(true);
controller->active_user_prefs_->CommitPendingWrite();
})); }));
} else { return;
active_user_prefs_->SetBoolean(prefs::kAccessibilityDictationEnabled,
enabled);
active_user_prefs_->CommitPendingWrite();
} }
active_user_prefs_->SetBoolean(prefs::kAccessibilityDictationEnabled,
enabled);
active_user_prefs_->CommitPendingWrite();
} }
bool AccessibilityController::IsDictationEnabled() const { bool AccessibilityController::IsDictationEnabled() const {
...@@ -827,6 +828,7 @@ void AccessibilityController::ObservePrefs(PrefService* prefs) { ...@@ -827,6 +828,7 @@ void AccessibilityController::ObservePrefs(PrefService* prefs) {
UpdateAutoclickDelayFromPref(); UpdateAutoclickDelayFromPref();
UpdateCaretHighlightFromPref(); UpdateCaretHighlightFromPref();
UpdateCursorHighlightFromPref(); UpdateCursorHighlightFromPref();
UpdateDictationFromPref();
UpdateFocusHighlightFromPref(); UpdateFocusHighlightFromPref();
UpdateHighContrastFromPref(); UpdateHighContrastFromPref();
UpdateLargeCursorFromPref(); 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