summaryrefslogtreecommitdiffstats
path: root/ash/high_contrast
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-12 05:18:25 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-12 05:18:25 +0000
commit0e3e7cbbea37a6303ddae4f7524968be622dca70 (patch)
treed0384948596c7284f1c82767f2849049d33281c7 /ash/high_contrast
parentfda0eec93a1819e8662619a32ccb8e52e8666e39 (diff)
downloadchromium_src-0e3e7cbbea37a6303ddae4f7524968be622dca70.zip
chromium_src-0e3e7cbbea37a6303ddae4f7524968be622dca70.tar.gz
chromium_src-0e3e7cbbea37a6303ddae4f7524968be622dca70.tar.bz2
Block keyboard and mouse input when maximize mode is activated by accelerometer.
BUG=353409 TEST=MaximizeModeControllerTest.BlocksKeyboardAndMouse Review URL: https://codereview.chromium.org/230613004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/high_contrast')
-rw-r--r--ash/high_contrast/high_contrast_controller.cc13
-rw-r--r--ash/high_contrast/high_contrast_controller.h11
2 files changed, 14 insertions, 10 deletions
diff --git a/ash/high_contrast/high_contrast_controller.cc b/ash/high_contrast/high_contrast_controller.cc
index 03618c56..418dd71 100644
--- a/ash/high_contrast/high_contrast_controller.cc
+++ b/ash/high_contrast/high_contrast_controller.cc
@@ -12,6 +12,11 @@ namespace ash {
HighContrastController::HighContrastController()
: enabled_(false) {
+ Shell::GetInstance()->AddShellObserver(this);
+}
+
+HighContrastController::~HighContrastController() {
+ Shell::GetInstance()->RemoveShellObserver(this);
}
void HighContrastController::SetEnabled(bool enabled) {
@@ -25,12 +30,12 @@ void HighContrastController::SetEnabled(bool enabled) {
}
}
-void HighContrastController::OnRootWindowAdded(aura::Window* root_window) {
- UpdateDisplay(root_window);
-}
-
void HighContrastController::UpdateDisplay(aura::Window* root_window) {
root_window->layer()->SetLayerInverted(enabled_);
}
+void HighContrastController::OnRootWindowAdded(aura::Window* root_window) {
+ UpdateDisplay(root_window);
+}
+
} // namespace ash
diff --git a/ash/high_contrast/high_contrast_controller.h b/ash/high_contrast/high_contrast_controller.h
index 49aca61..10d0b7d 100644
--- a/ash/high_contrast/high_contrast_controller.h
+++ b/ash/high_contrast/high_contrast_controller.h
@@ -6,26 +6,25 @@
#define ASH_HIGH_CONTRAST_HIGH_CONTRAST_CONTROLLER_H_
#include "ash/ash_export.h"
+#include "ash/shell_observer.h"
#include "base/basictypes.h"
namespace aura {
-class RootWindow;
class Window;
}
namespace ash {
-class ASH_EXPORT HighContrastController {
+class ASH_EXPORT HighContrastController : public ShellObserver {
public:
HighContrastController();
-
- ~HighContrastController() {}
+ virtual ~HighContrastController();
// Set high contrast mode and update all available displays.
void SetEnabled(bool enabled);
- // Update high contrast mode on the just added display.
- void OnRootWindowAdded(aura::Window* root_window);
+ // ShellObserver:
+ virtual void OnRootWindowAdded(aura::Window* root_window) OVERRIDE;
private:
// Update high contrast mode on the passed display.