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

Side by Side Diff: ash/shell.cc

Issue 10201014: Implement High Contrast mode for Chrome OS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Working implementation Created 8 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/app_list/app_list.h" 9 #include "ash/app_list/app_list.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/desktop_background/desktop_background_controller.h" 11 #include "ash/desktop_background/desktop_background_controller.h"
12 #include "ash/desktop_background/desktop_background_resources.h" 12 #include "ash/desktop_background/desktop_background_resources.h"
13 #include "ash/desktop_background/desktop_background_view.h" 13 #include "ash/desktop_background/desktop_background_view.h"
14 #include "ash/drag_drop/drag_drop_controller.h" 14 #include "ash/drag_drop/drag_drop_controller.h"
15 #include "ash/focus_cycler.h" 15 #include "ash/focus_cycler.h"
16 #include "ash/high_contrast/high_contrast_controller.h"
16 #include "ash/ime/input_method_event_filter.h" 17 #include "ash/ime/input_method_event_filter.h"
17 #include "ash/launcher/launcher.h" 18 #include "ash/launcher/launcher.h"
18 #include "ash/magnifier/magnification_controller.h" 19 #include "ash/magnifier/magnification_controller.h"
19 #include "ash/monitor/monitor_controller.h" 20 #include "ash/monitor/monitor_controller.h"
20 #include "ash/monitor/multi_monitor_manager.h" 21 #include "ash/monitor/multi_monitor_manager.h"
21 #include "ash/screen_ash.h" 22 #include "ash/screen_ash.h"
22 #include "ash/shell_context_menu.h" 23 #include "ash/shell_context_menu.h"
23 #include "ash/shell_delegate.h" 24 #include "ash/shell_delegate.h"
24 #include "ash/shell_factory.h" 25 #include "ash/shell_factory.h"
25 #include "ash/shell_window_ids.h" 26 #include "ash/shell_window_ids.h"
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 window_modality_controller_.reset(new internal::WindowModalityController); 729 window_modality_controller_.reset(new internal::WindowModalityController);
729 AddRootWindowEventFilter(window_modality_controller_.get()); 730 AddRootWindowEventFilter(window_modality_controller_.get());
730 731
731 visibility_controller_.reset(new internal::VisibilityController); 732 visibility_controller_.reset(new internal::VisibilityController);
732 733
733 tooltip_controller_.reset(new internal::TooltipController); 734 tooltip_controller_.reset(new internal::TooltipController);
734 AddRootWindowEventFilter(tooltip_controller_.get()); 735 AddRootWindowEventFilter(tooltip_controller_.get());
735 736
736 drag_drop_controller_.reset(new internal::DragDropController); 737 drag_drop_controller_.reset(new internal::DragDropController);
737 magnification_controller_.reset(new internal::MagnificationController); 738 magnification_controller_.reset(new internal::MagnificationController);
739 high_contrast_controller_.reset(new internal::HighContrastController);
738 power_button_controller_.reset(new PowerButtonController); 740 power_button_controller_.reset(new PowerButtonController);
739 AddShellObserver(power_button_controller_.get()); 741 AddShellObserver(power_button_controller_.get());
740 video_detector_.reset(new VideoDetector); 742 video_detector_.reset(new VideoDetector);
741 window_cycle_controller_.reset(new WindowCycleController); 743 window_cycle_controller_.reset(new WindowCycleController);
742 monitor_controller_.reset(new internal::MonitorController); 744 monitor_controller_.reset(new internal::MonitorController);
743 screen_dimmer_.reset(new internal::ScreenDimmer); 745 screen_dimmer_.reset(new internal::ScreenDimmer);
746
747 high_contrast_controller_->SetEnable(delegate_->IsHighContrastEnabled());
744 } 748 }
745 749
746 aura::Window* Shell::GetContainer(int container_id) { 750 aura::Window* Shell::GetContainer(int container_id) {
747 return const_cast<aura::Window*>( 751 return const_cast<aura::Window*>(
748 const_cast<const Shell*>(this)->GetContainer(container_id)); 752 const_cast<const Shell*>(this)->GetContainer(container_id));
749 } 753 }
750 754
751 const aura::Window* Shell::GetContainer(int container_id) const { 755 const aura::Window* Shell::GetContainer(int container_id) const {
752 return GetRootWindow()->GetChildById(container_id); 756 return GetRootWindow()->GetChildById(container_id);
753 } 757 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 panel_container->SetLayoutManager(panel_layout_manager_); 932 panel_container->SetLayoutManager(panel_layout_manager_);
929 } 933 }
930 } 934 }
931 935
932 void Shell::DisableWorkspaceGridLayout() { 936 void Shell::DisableWorkspaceGridLayout() {
933 if (workspace_controller_.get()) 937 if (workspace_controller_.get())
934 workspace_controller_->workspace_manager()->set_grid_size(0); 938 workspace_controller_->workspace_manager()->set_grid_size(0);
935 } 939 }
936 940
937 } // namespace ash 941 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698