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 a3111806e5ebc1b6b466bb26435205c3753a605f..99b75521a84a33e479c343f8599463057f71eee3 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" |
@@ -175,13 +176,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 |
} |
@@ -234,13 +241,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) { |