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

Unified Diff: ash/high_contrast/high_contrast_controller.cc

Issue 10962008: High contrast mode support for multiple displays. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed code style. Created 8 years, 3 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
« no previous file with comments | « ash/high_contrast/high_contrast_controller.h ('k') | ash/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 978f11ee3346586a466f79bf589146adf95ee821..31a0dbbcc6c39d05385299791e1e6c628e8e8c19 100644
--- a/ash/high_contrast/high_contrast_controller.cc
+++ b/ash/high_contrast/high_contrast_controller.cc
@@ -12,13 +12,25 @@ namespace ash {
HighContrastController::HighContrastController()
: enabled_(false) {
- root_window_ = ash::Shell::GetPrimaryRootWindow();
}
void HighContrastController::SetEnabled(bool enabled) {
enabled_ = enabled;
- root_window_->layer()->SetLayerInverted(enabled_);
+ // Update all active displays.
+ Shell::RootWindowList root_window_list = Shell::GetAllRootWindows();
+ for (Shell::RootWindowList::iterator it = root_window_list.begin();
+ it != root_window_list.end(); it++) {
+ UpdateDisplay(*it);
+ }
+}
+
+void HighContrastController::OnRootWindowAdded(aura::RootWindow* root_window) {
+ UpdateDisplay(root_window);
+}
+
+void HighContrastController::UpdateDisplay(aura::RootWindow* root_window) {
+ root_window->layer()->SetLayerInverted(enabled_);
}
} // namespace ash
« no previous file with comments | « ash/high_contrast/high_contrast_controller.h ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698