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

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

Issue 10201014: Implement High Contrast mode for Chrome OS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Working implementation Created 8 years, 7 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
diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc
index 480ba53fbabb2cb3b874a93a27e8ac0c0fbe13a9..fc456483d277b02bb6af3fdb74a97065da3a764e 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_util.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc
@@ -6,6 +6,8 @@
#include <queue>
+#include "ash/shell.h"
+#include "ash/high_contrast/high_contrast_controller.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
@@ -163,6 +165,8 @@ void EnableHighContrast(bool enabled) {
PrefService* pref_service = g_browser_process->local_state();
pref_service->SetBoolean(prefs::kHighContrastEnabled, enabled);
pref_service->CommitPendingWrite();
+
+ ash::Shell::GetInstance()->high_contrast_controller()->SetEnable(enabled);
}
void EnableScreenMagnifier(bool enabled) {
@@ -204,6 +208,16 @@ bool IsSpokenFeedbackEnabled() {
return spoken_feedback_enabled;
}
+bool IsHighContrastEnabled() {
+ if (!g_browser_process) {
+ return false;
+ }
+ PrefService* prefs = g_browser_process->local_state();
+ bool high_contrast_enabled = prefs &&
+ prefs->GetBoolean(prefs::kHighContrastEnabled);
+ return high_contrast_enabled;
+}
+
void MaybeSpeak(const std::string& utterance) {
if (IsSpokenFeedbackEnabled())
Speak(utterance);

Powered by Google App Engine
This is Rietveld 408576698