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 |