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

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: Remove extra define guard 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 9704d35786238e0bd47a55f1b2dbc5b3f60ca5a3..253efe608c91d10aaf1cd9c3f3183f8d19b7765e 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/high_contrast/high_contrast_controller.h"
+#include "ash/shell.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
@@ -164,6 +166,10 @@ void EnableHighContrast(bool enabled) {
PrefService* pref_service = g_browser_process->local_state();
pref_service->SetBoolean(prefs::kHighContrastEnabled, enabled);
pref_service->CommitPendingWrite();
+
+#if defined(USE_ASH)
+ ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled(enabled);
+#endif
}
void EnableScreenMagnifier(bool enabled) {
@@ -205,6 +211,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);
« no previous file with comments | « chrome/browser/chromeos/accessibility/accessibility_util.h ('k') | chrome/browser/resources/options2/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698