diff options
Diffstat (limited to 'ash/high_contrast')
-rw-r--r-- | ash/high_contrast/high_contrast_controller.cc | 24 | ||||
-rw-r--r-- | ash/high_contrast/high_contrast_controller.h | 36 |
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_ |