Commit 62007508 authored by Sara Kato's avatar Sara Kato Committed by Commit Bot

Reflect fullscreen magnifier accelerator toggle in settings and tray

Currently, when ctrl+search+m is used to toggle the magnifier,
this is not reflected in chrome://settings.

However, the other accelerators (docked magnifier and high contrast)
are reflected in settings.

Bug: 853104
Test: Manual
Change-Id: Ia70b868eb89598ba90b79e2e5da482bd0bb6a916
Reviewed-on: https://chromium-review.googlesource.com/1114524
Commit-Queue: Sara Kato <sarakato@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572416}
parent 0720dad7
......@@ -880,7 +880,13 @@ void SetFullscreenMagnifierEnabled(bool enabled) {
} else {
RemoveStickyNotitification(kFullscreenMagnifierToggleAccelNotificationId);
}
Shell::Get()->magnification_controller()->SetEnabled(enabled);
// TODO (afakhry): Move the below into a single call (crbug/817157).
// Necessary to make magnification controller in ash observe changes to the
// prefs iteself.
Shell* shell = Shell::Get();
shell->accessibility_controller()->SetFullscreenMagnifierEnabled(enabled);
shell->magnification_controller()->SetEnabled(enabled);
}
void SetHighContrastEnabled(bool enabled) {
......
......@@ -426,6 +426,14 @@ bool AccessibilityController::IsFocusHighlightEnabled() const {
return focus_highlight_enabled_;
}
void AccessibilityController::SetFullscreenMagnifierEnabled(bool enabled) {
if (!active_user_prefs_)
return;
active_user_prefs_->SetBoolean(prefs::kAccessibilityScreenMagnifierEnabled,
enabled);
active_user_prefs_->CommitPendingWrite();
}
void AccessibilityController::SetHighContrastEnabled(bool enabled) {
if (!active_user_prefs_)
return;
......
......@@ -80,6 +80,8 @@ class ASH_EXPORT AccessibilityController
void SetFocusHighlightEnabled(bool enabled);
bool IsFocusHighlightEnabled() const;
void SetFullscreenMagnifierEnabled(bool enabled);
void SetHighContrastEnabled(bool enabled);
bool IsHighContrastEnabled() const;
......
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