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

Side by Side Diff: ash/shell.cc

Issue 10263011: chromeos: Add support for dimming the screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test 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 | Annotate | Revision Log
« no previous file with comments | « ash/shell.h ('k') | ash/wm/screen_dimmer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 23 matching lines...) Expand all
34 #include "ash/wm/dialog_frame_view.h" 34 #include "ash/wm/dialog_frame_view.h"
35 #include "ash/wm/event_client_impl.h" 35 #include "ash/wm/event_client_impl.h"
36 #include "ash/wm/key_rewriter_event_filter.h" 36 #include "ash/wm/key_rewriter_event_filter.h"
37 #include "ash/wm/panel_layout_manager.h" 37 #include "ash/wm/panel_layout_manager.h"
38 #include "ash/wm/panel_window_event_filter.h" 38 #include "ash/wm/panel_window_event_filter.h"
39 #include "ash/wm/partial_screenshot_event_filter.h" 39 #include "ash/wm/partial_screenshot_event_filter.h"
40 #include "ash/wm/power_button_controller.h" 40 #include "ash/wm/power_button_controller.h"
41 #include "ash/wm/resize_shadow_controller.h" 41 #include "ash/wm/resize_shadow_controller.h"
42 #include "ash/wm/root_window_event_filter.h" 42 #include "ash/wm/root_window_event_filter.h"
43 #include "ash/wm/root_window_layout_manager.h" 43 #include "ash/wm/root_window_layout_manager.h"
44 #include "ash/wm/screen_dimmer.h"
44 #include "ash/wm/shadow_controller.h" 45 #include "ash/wm/shadow_controller.h"
45 #include "ash/wm/shelf_layout_manager.h" 46 #include "ash/wm/shelf_layout_manager.h"
46 #include "ash/wm/stacking_controller.h" 47 #include "ash/wm/stacking_controller.h"
47 #include "ash/wm/status_area_layout_manager.h" 48 #include "ash/wm/status_area_layout_manager.h"
48 #include "ash/wm/system_gesture_event_filter.h" 49 #include "ash/wm/system_gesture_event_filter.h"
49 #include "ash/wm/system_modal_container_layout_manager.h" 50 #include "ash/wm/system_modal_container_layout_manager.h"
50 #include "ash/wm/toplevel_window_event_filter.h" 51 #include "ash/wm/toplevel_window_event_filter.h"
51 #include "ash/wm/video_detector.h" 52 #include "ash/wm/video_detector.h"
52 #include "ash/wm/visibility_controller.h" 53 #include "ash/wm/visibility_controller.h"
53 #include "ash/wm/window_cycle_controller.h" 54 #include "ash/wm/window_cycle_controller.h"
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 delete child; 569 delete child;
569 } 570 }
570 571
571 // These need a valid Shell instance to clean up properly, so explicitly 572 // These need a valid Shell instance to clean up properly, so explicitly
572 // delete them before invalidating the instance. 573 // delete them before invalidating the instance.
573 // Alphabetical. 574 // Alphabetical.
574 activation_controller_.reset(); 575 activation_controller_.reset();
575 drag_drop_controller_.reset(); 576 drag_drop_controller_.reset();
576 magnification_controller_.reset(); 577 magnification_controller_.reset();
577 resize_shadow_controller_.reset(); 578 resize_shadow_controller_.reset();
579 screen_dimmer_.reset();
578 shadow_controller_.reset(); 580 shadow_controller_.reset();
579 window_cycle_controller_.reset(); 581 window_cycle_controller_.reset();
580 event_client_.reset(); 582 event_client_.reset();
581 monitor_controller_.reset(); 583 monitor_controller_.reset();
582 tooltip_controller_.reset(); 584 tooltip_controller_.reset();
583 585
584 // Launcher widget has a InputMethodBridge that references to 586 // Launcher widget has a InputMethodBridge that references to
585 // input_method_filter_'s input_method_. So explicitly release launcher_ 587 // input_method_filter_'s input_method_. So explicitly release launcher_
586 // before input_method_filter_. And this needs to be after we delete all 588 // before input_method_filter_. And this needs to be after we delete all
587 // containers in case there are still live browser windows which access 589 // containers in case there are still live browser windows which access
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 tooltip_controller_.reset(new internal::TooltipController); 722 tooltip_controller_.reset(new internal::TooltipController);
721 AddRootWindowEventFilter(tooltip_controller_.get()); 723 AddRootWindowEventFilter(tooltip_controller_.get());
722 724
723 drag_drop_controller_.reset(new internal::DragDropController); 725 drag_drop_controller_.reset(new internal::DragDropController);
724 magnification_controller_.reset(new internal::MagnificationController); 726 magnification_controller_.reset(new internal::MagnificationController);
725 power_button_controller_.reset(new PowerButtonController); 727 power_button_controller_.reset(new PowerButtonController);
726 AddShellObserver(power_button_controller_.get()); 728 AddShellObserver(power_button_controller_.get());
727 video_detector_.reset(new VideoDetector); 729 video_detector_.reset(new VideoDetector);
728 window_cycle_controller_.reset(new WindowCycleController); 730 window_cycle_controller_.reset(new WindowCycleController);
729 monitor_controller_.reset(new internal::MonitorController); 731 monitor_controller_.reset(new internal::MonitorController);
732 screen_dimmer_.reset(new internal::ScreenDimmer);
730 } 733 }
731 734
732 aura::Window* Shell::GetContainer(int container_id) { 735 aura::Window* Shell::GetContainer(int container_id) {
733 return const_cast<aura::Window*>( 736 return const_cast<aura::Window*>(
734 const_cast<const Shell*>(this)->GetContainer(container_id)); 737 const_cast<const Shell*>(this)->GetContainer(container_id));
735 } 738 }
736 739
737 const aura::Window* Shell::GetContainer(int container_id) const { 740 const aura::Window* Shell::GetContainer(int container_id) const {
738 return GetRootWindow()->GetChildById(container_id); 741 return GetRootWindow()->GetChildById(container_id);
739 } 742 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 panel_container->SetLayoutManager(panel_layout_manager_); 917 panel_container->SetLayoutManager(panel_layout_manager_);
915 } 918 }
916 } 919 }
917 920
918 void Shell::DisableWorkspaceGridLayout() { 921 void Shell::DisableWorkspaceGridLayout() {
919 if (workspace_controller_.get()) 922 if (workspace_controller_.get())
920 workspace_controller_->workspace_manager()->set_grid_size(0); 923 workspace_controller_->workspace_manager()->set_grid_size(0);
921 } 924 }
922 925
923 } // namespace ash 926 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/screen_dimmer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698