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

Unified Diff: ash/high_contrast/high_contrast_controller.cc

Issue 230613004: Block keyboard and mouse input when maximize mode is activated by accelerometer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use event targeter to block keyboard and mouse events. Created 6 years, 8 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: ash/high_contrast/high_contrast_controller.cc
diff --git a/ash/high_contrast/high_contrast_controller.cc b/ash/high_contrast/high_contrast_controller.cc
index 03618c56ba3c0be7c272c0c879c9bc77a12557fb..418dd7162c1768bcd4b66a478039e4d6611b8bee 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

Powered by Google App Engine
This is Rietveld 408576698