summaryrefslogtreecommitdiffstats
path: root/ash/high_contrast
diff options
context:
space:
mode:
authorzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 04:19:10 +0000
committerzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 04:19:10 +0000
commita3f3a6b53f7ccdd09475571eceafd3e29dbf83f4 (patch)
tree11948f41e28593fae0b89638d411b49be6c0c986 /ash/high_contrast
parent4cd05baa05b86933b037c8cc85b00dda32cbc727 (diff)
downloadchromium_src-a3f3a6b53f7ccdd09475571eceafd3e29dbf83f4.zip
chromium_src-a3f3a6b53f7ccdd09475571eceafd3e29dbf83f4.tar.gz
chromium_src-a3f3a6b53f7ccdd09475571eceafd3e29dbf83f4.tar.bz2
Implement High Contrast mode for Chrome OS.
-Add controller to ash for managing the state of High Contrast mode -Add API to shell to allow Chromium to turn the mode on and off -Add the option to the Chromium OS accessibility settings page. -Add functions to layer.cc/h to enable an inversion filter. BUG=chromium-os:30678 Review URL: https://chromiumcodereview.appspot.com/10201014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/high_contrast')
-rw-r--r--ash/high_contrast/high_contrast_controller.cc24
-rw-r--r--ash/high_contrast/high_contrast_controller.h36
2 files changed, 60 insertions, 0 deletions
diff --git a/ash/high_contrast/high_contrast_controller.cc b/ash/high_contrast/high_contrast_controller.cc
new file mode 100644
index 0000000..b501fc9
--- /dev/null
+++ b/ash/high_contrast/high_contrast_controller.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/high_contrast/high_contrast_controller.h"
+
+#include "ash/shell.h"
+#include "ui/aura/root_window.h"
+#include "ui/compositor/layer.h"
+
+namespace ash {
+
+HighContrastController::HighContrastController()
+ : enabled_(false) {
+ root_window_ = ash::Shell::GetRootWindow();
+}
+
+void HighContrastController::SetEnabled(bool enabled) {
+ enabled_ = enabled;
+
+ root_window_->layer()->SetInverted(enabled_);
+}
+
+} // namespace ash
diff --git a/ash/high_contrast/high_contrast_controller.h b/ash/high_contrast/high_contrast_controller.h
new file mode 100644
index 0000000..b5b589f
--- /dev/null
+++ b/ash/high_contrast/high_contrast_controller.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_HIGH_CONTRAST_HIGH_CONTRAST_CONTROLLER_H_
+#define ASH_HIGH_CONTRAST_HIGH_CONTRAST_CONTROLLER_H_
+#pragma once
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+
+namespace aura {
+class RootWindow;
+}
+
+namespace ash {
+
+class ASH_EXPORT HighContrastController {
+ public:
+ HighContrastController();
+
+ ~HighContrastController() {}
+
+ void SetEnabled(bool enabled);
+
+ private:
+ aura::RootWindow* root_window_;
+
+ bool enabled_;
+
+ DISALLOW_COPY_AND_ASSIGN(HighContrastController);
+};
+
+} // namespace ash
+
+#endif // ASH_HIGH_CONTRAST_HIGH_CONTRAST_CONTROLLER_H_