Chromium Code Reviews| Index: chrome/browser/chromeos/accessibility/accessibility_util.cc |
| diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc |
| index 28f4ea5aa46283cb4b0a0e2680a4ca75cfd1824d..722c0b63a2717a42d85e93a891ef49e7a722411b 100644 |
| --- a/chrome/browser/chromeos/accessibility/accessibility_util.cc |
| +++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc |
| @@ -8,6 +8,7 @@ |
| #include "ash/high_contrast/high_contrast_controller.h" |
| #include "ash/magnifier/magnification_controller.h" |
| +#include "ash/magnifier/partial_magnification_controller.h" |
| #include "ash/shell.h" |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| @@ -185,13 +186,19 @@ void EnableHighContrast(bool enabled) { |
| #endif |
| } |
| -void EnableScreenMagnifier(bool enabled) { |
| +void SetScreenMagnifier(ScreenMagnifierType type) { |
| PrefService* pref_service = g_browser_process->local_state(); |
| - pref_service->SetBoolean(prefs::kScreenMagnifierEnabled, enabled); |
| + pref_service->SetBoolean(prefs::kScreenMagnifierEnabled, |
|
sky
2012/11/12 15:23:46
Can we have a single string preference for these?
Zachary Kuznia
2012/11/13 08:16:15
Done.
|
| + type == MagnifierFull); |
| + pref_service->SetBoolean(prefs::kPartialScreenMagnifierEnabled, |
| + type == MagnifierPartial); |
| pref_service->CommitPendingWrite(); |
| #if defined(USE_ASH) |
| - ash::Shell::GetInstance()->magnification_controller()->SetEnabled(enabled); |
| + ash::Shell::GetInstance()->magnification_controller()->SetEnabled( |
| + type == MagnifierFull); |
| + ash::Shell::GetInstance()->partial_magnification_controller()->SetEnabled( |
| + type == MagnifierPartial); |
| #endif |
| } |
| @@ -244,13 +251,20 @@ bool IsHighContrastEnabled() { |
| return high_contrast_enabled; |
| } |
| -bool IsScreenMagnifierEnabled() { |
| - if (!g_browser_process) { |
| - return false; |
| - } |
| +ScreenMagnifierType GetScreenMagnifierType() { |
| + if (!g_browser_process) |
| + return MagnifierNone; |
| + |
| PrefService* prefs = g_browser_process->local_state(); |
| - bool enabled = prefs && prefs->GetBoolean(prefs::kScreenMagnifierEnabled); |
| - return enabled; |
| + if (!prefs) |
| + return MagnifierNone; |
| + |
| + if (prefs->GetBoolean(prefs::kScreenMagnifierEnabled)) |
| + return MagnifierFull; |
| + else if (prefs->GetBoolean(prefs::kPartialScreenMagnifierEnabled)) |
| + return MagnifierPartial; |
| + else |
| + return MagnifierNone; |
| } |
| void MaybeSpeak(const std::string& utterance) { |