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 621306128601f15beacd6db54e0dc154a5bd34e6..2e9db068c333949ece3b9066c6a8e54e6e273e66 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" |
| @@ -173,13 +174,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, |
| + 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 |
| } |
| @@ -232,13 +239,20 @@ bool IsHighContrastEnabled() { |
| return high_contrast_enabled; |
| } |
| -bool IsScreenMagnifierEnabled() { |
| +ScreenMagnifierType GetScreenMagnifierType() { |
| if (!g_browser_process) { |
| - return false; |
| + return MagnifierNone; |
| } |
|
oshima
2012/09/13 16:35:31
nuke {}
Zachary Kuznia
2012/10/09 09:02:36
Done.
|
| 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) { |