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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 231 |
231 // Destroy all child windows including widgets. | 232 // Destroy all child windows including widgets. |
232 display_controller_->CloseChildWindows(); | 233 display_controller_->CloseChildWindows(); |
233 | 234 |
234 // These need a valid Shell instance to clean up properly, so explicitly | 235 // These need a valid Shell instance to clean up properly, so explicitly |
235 // delete them before invalidating the instance. | 236 // delete them before invalidating the instance. |
236 // Alphabetical. | 237 // Alphabetical. |
237 drag_drop_controller_.reset(); | 238 drag_drop_controller_.reset(); |
238 magnification_controller_.reset(); | 239 magnification_controller_.reset(); |
239 power_button_controller_.reset(); | 240 power_button_controller_.reset(); |
| 241 session_state_controller_.reset(); |
240 resize_shadow_controller_.reset(); | 242 resize_shadow_controller_.reset(); |
241 shadow_controller_.reset(); | 243 shadow_controller_.reset(); |
242 tooltip_controller_.reset(); | 244 tooltip_controller_.reset(); |
243 event_client_.reset(); | 245 event_client_.reset(); |
244 window_cycle_controller_.reset(); | 246 window_cycle_controller_.reset(); |
245 capture_controller_.reset(); | 247 capture_controller_.reset(); |
246 nested_dispatcher_controller_.reset(); | 248 nested_dispatcher_controller_.reset(); |
247 user_action_client_.reset(); | 249 user_action_client_.reset(); |
248 visibility_controller_.reset(); | 250 visibility_controller_.reset(); |
249 | 251 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 473 |
472 // Force Layout | 474 // Force Layout |
473 root_window_controller->root_window_layout()->OnWindowResized(); | 475 root_window_controller->root_window_layout()->OnWindowResized(); |
474 | 476 |
475 // It needs to be created after OnWindowResized has been called, otherwise the | 477 // It needs to be created after OnWindowResized has been called, otherwise the |
476 // widget will not paint when restoring after a browser crash. Also it needs | 478 // widget will not paint when restoring after a browser crash. Also it needs |
477 // to be created after InitSecondaryDisplays() to initialize the wallpapers in | 479 // to be created after InitSecondaryDisplays() to initialize the wallpapers in |
478 // the correct size. | 480 // the correct size. |
479 user_wallpaper_delegate_->InitializeWallpaper(); | 481 user_wallpaper_delegate_->InitializeWallpaper(); |
480 | 482 |
481 power_button_controller_.reset(new PowerButtonController); | 483 session_state_controller_.reset(new SessionStateController); |
482 AddShellObserver(power_button_controller_.get()); | 484 power_button_controller_.reset(new PowerButtonController( |
| 485 session_state_controller_.get())); |
| 486 AddShellObserver(session_state_controller_.get()); |
483 | 487 |
484 if (initially_hide_cursor_) | 488 if (initially_hide_cursor_) |
485 cursor_manager_.ShowCursor(false); | 489 cursor_manager_.ShowCursor(false); |
486 | 490 |
487 // Cursor might have been hidden by somethign other than chrome. | 491 // Cursor might have been hidden by somethign other than chrome. |
488 // Let the first mouse event show the cursor. | 492 // Let the first mouse event show the cursor. |
489 env_filter_->set_cursor_hidden_by_filter(true); | 493 env_filter_->set_cursor_hidden_by_filter(true); |
490 } | 494 } |
491 | 495 |
492 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { | 496 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 iter != controllers.end(); ++iter) { | 752 iter != controllers.end(); ++iter) { |
749 if ((*iter)->GetSystemModalLayoutManager(window)-> | 753 if ((*iter)->GetSystemModalLayoutManager(window)-> |
750 CanWindowReceiveEvents(window)) { | 754 CanWindowReceiveEvents(window)) { |
751 return true; | 755 return true; |
752 } | 756 } |
753 } | 757 } |
754 return false; | 758 return false; |
755 } | 759 } |
756 | 760 |
757 } // namespace ash | 761 } // namespace ash |
OLD | NEW |