Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_util.cc

Issue 11194011: Reverting this CL because it was committed before I gave the final LGTM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/accessibility/accessibility_util.cc
===================================================================
--- chrome/browser/chromeos/accessibility/accessibility_util.cc (revision 162209)
+++ chrome/browser/chromeos/accessibility/accessibility_util.cc (working copy)
@@ -14,7 +14,6 @@
#include "base/logging.h"
#include "chrome/browser/accessibility/accessibility_extension_api.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/file_reader.h"
@@ -177,8 +176,13 @@
}
void EnableScreenMagnifier(bool enabled) {
- if (MagnificationManager::GetInstance())
- MagnificationManager::GetInstance()->SetEnabled(enabled);
+ PrefService* pref_service = g_browser_process->local_state();
+ pref_service->SetBoolean(prefs::kScreenMagnifierEnabled, enabled);
+ pref_service->CommitPendingWrite();
+
+#if defined(USE_ASH)
+ ash::Shell::GetInstance()->magnification_controller()->SetEnabled(enabled);
+#endif
}
void EnableVirtualKeyboard(bool enabled) {
@@ -231,8 +235,12 @@
}
bool IsScreenMagnifierEnabled() {
- return MagnificationManager::GetInstance() &&
- MagnificationManager::GetInstance()->IsEnabled();
+ if (!g_browser_process) {
+ return false;
+ }
+ PrefService* prefs = g_browser_process->local_state();
+ bool enabled = prefs && prefs->GetBoolean(prefs::kScreenMagnifierEnabled);
+ return enabled;
}
void MaybeSpeak(const std::string& utterance) {
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | chrome/browser/chromeos/accessibility/magnification_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698