OLD | NEW |
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 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "ash/wm/custom_frame_view_ash.h" | 39 #include "ash/wm/custom_frame_view_ash.h" |
40 #include "ash/wm/dialog_frame_view.h" | 40 #include "ash/wm/dialog_frame_view.h" |
41 #include "ash/wm/event_client_impl.h" | 41 #include "ash/wm/event_client_impl.h" |
42 #include "ash/wm/event_rewriter_event_filter.h" | 42 #include "ash/wm/event_rewriter_event_filter.h" |
43 #include "ash/wm/overlay_event_filter.h" | 43 #include "ash/wm/overlay_event_filter.h" |
44 #include "ash/wm/power_button_controller.h" | 44 #include "ash/wm/power_button_controller.h" |
45 #include "ash/wm/property_util.h" | 45 #include "ash/wm/property_util.h" |
46 #include "ash/wm/resize_shadow_controller.h" | 46 #include "ash/wm/resize_shadow_controller.h" |
47 #include "ash/wm/root_window_layout_manager.h" | 47 #include "ash/wm/root_window_layout_manager.h" |
48 #include "ash/wm/screen_dimmer.h" | 48 #include "ash/wm/screen_dimmer.h" |
| 49 #include "ash/wm/session_state_controller.h" |
49 #include "ash/wm/shadow_controller.h" | 50 #include "ash/wm/shadow_controller.h" |
50 #include "ash/wm/stacking_controller.h" | 51 #include "ash/wm/stacking_controller.h" |
51 #include "ash/wm/system_gesture_event_filter.h" | 52 #include "ash/wm/system_gesture_event_filter.h" |
52 #include "ash/wm/system_modal_container_event_filter.h" | 53 #include "ash/wm/system_modal_container_event_filter.h" |
53 #include "ash/wm/system_modal_container_layout_manager.h" | 54 #include "ash/wm/system_modal_container_layout_manager.h" |
54 #include "ash/wm/user_activity_detector.h" | 55 #include "ash/wm/user_activity_detector.h" |
55 #include "ash/wm/video_detector.h" | 56 #include "ash/wm/video_detector.h" |
56 #include "ash/wm/visibility_controller.h" | 57 #include "ash/wm/visibility_controller.h" |
57 #include "ash/wm/window_cycle_controller.h" | 58 #include "ash/wm/window_cycle_controller.h" |
58 #include "ash/wm/window_modality_controller.h" | 59 #include "ash/wm/window_modality_controller.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 241 |
241 // Destroy all child windows including widgets. | 242 // Destroy all child windows including widgets. |
242 display_controller_->CloseChildWindows(); | 243 display_controller_->CloseChildWindows(); |
243 | 244 |
244 // These need a valid Shell instance to clean up properly, so explicitly | 245 // These need a valid Shell instance to clean up properly, so explicitly |
245 // delete them before invalidating the instance. | 246 // delete them before invalidating the instance. |
246 // Alphabetical. | 247 // Alphabetical. |
247 drag_drop_controller_.reset(); | 248 drag_drop_controller_.reset(); |
248 magnification_controller_.reset(); | 249 magnification_controller_.reset(); |
249 power_button_controller_.reset(); | 250 power_button_controller_.reset(); |
| 251 session_state_controller_.reset(); |
250 resize_shadow_controller_.reset(); | 252 resize_shadow_controller_.reset(); |
251 shadow_controller_.reset(); | 253 shadow_controller_.reset(); |
252 tooltip_controller_.reset(); | 254 tooltip_controller_.reset(); |
253 event_client_.reset(); | 255 event_client_.reset(); |
254 window_cycle_controller_.reset(); | 256 window_cycle_controller_.reset(); |
255 capture_controller_.reset(); | 257 capture_controller_.reset(); |
256 nested_dispatcher_controller_.reset(); | 258 nested_dispatcher_controller_.reset(); |
257 user_action_client_.reset(); | 259 user_action_client_.reset(); |
258 visibility_controller_.reset(); | 260 visibility_controller_.reset(); |
259 | 261 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 483 |
482 // Force Layout | 484 // Force Layout |
483 root_window_controller->root_window_layout()->OnWindowResized(); | 485 root_window_controller->root_window_layout()->OnWindowResized(); |
484 | 486 |
485 // It needs to be created after OnWindowResized has been called, otherwise the | 487 // It needs to be created after OnWindowResized has been called, otherwise the |
486 // widget will not paint when restoring after a browser crash. Also it needs | 488 // widget will not paint when restoring after a browser crash. Also it needs |
487 // to be created after InitSecondaryDisplays() to initialize the wallpapers in | 489 // to be created after InitSecondaryDisplays() to initialize the wallpapers in |
488 // the correct size. | 490 // the correct size. |
489 user_wallpaper_delegate_->InitializeWallpaper(); | 491 user_wallpaper_delegate_->InitializeWallpaper(); |
490 | 492 |
491 power_button_controller_.reset(new PowerButtonController); | 493 session_state_controller_.reset(new SessionStateController); |
492 AddShellObserver(power_button_controller_.get()); | 494 power_button_controller_.reset(new PowerButtonController( |
| 495 session_state_controller_.get())); |
| 496 AddShellObserver(session_state_controller_.get()); |
493 | 497 |
494 if (initially_hide_cursor_) | 498 if (initially_hide_cursor_) |
495 cursor_manager_.ShowCursor(false); | 499 cursor_manager_.ShowCursor(false); |
496 | 500 |
497 // Cursor might have been hidden by somethign other than chrome. | 501 // Cursor might have been hidden by somethign other than chrome. |
498 // Let the first mouse event show the cursor. | 502 // Let the first mouse event show the cursor. |
499 env_filter_->set_cursor_hidden_by_filter(true); | 503 env_filter_->set_cursor_hidden_by_filter(true); |
500 } | 504 } |
501 | 505 |
502 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { | 506 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 iter != controllers.end(); ++iter) { | 762 iter != controllers.end(); ++iter) { |
759 if ((*iter)->GetSystemModalLayoutManager(window)-> | 763 if ((*iter)->GetSystemModalLayoutManager(window)-> |
760 CanWindowReceiveEvents(window)) { | 764 CanWindowReceiveEvents(window)) { |
761 return true; | 765 return true; |
762 } | 766 } |
763 } | 767 } |
764 return false; | 768 return false; |
765 } | 769 } |
766 | 770 |
767 } // namespace ash | 771 } // namespace ash |
OLD | NEW |