| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "ash/wm/event_rewriter_event_filter.h" | 49 #include "ash/wm/event_rewriter_event_filter.h" |
| 50 #include "ash/wm/overlay_event_filter.h" | 50 #include "ash/wm/overlay_event_filter.h" |
| 51 #include "ash/wm/power_button_controller.h" | 51 #include "ash/wm/power_button_controller.h" |
| 52 #include "ash/wm/property_util.h" | 52 #include "ash/wm/property_util.h" |
| 53 #include "ash/wm/resize_shadow_controller.h" | 53 #include "ash/wm/resize_shadow_controller.h" |
| 54 #include "ash/wm/root_window_layout_manager.h" | 54 #include "ash/wm/root_window_layout_manager.h" |
| 55 #include "ash/wm/screen_dimmer.h" | 55 #include "ash/wm/screen_dimmer.h" |
| 56 #include "ash/wm/session_state_controller.h" | 56 #include "ash/wm/session_state_controller.h" |
| 57 #include "ash/wm/session_state_controller_impl.h" | 57 #include "ash/wm/session_state_controller_impl.h" |
| 58 #include "ash/wm/session_state_controller_impl2.h" | 58 #include "ash/wm/session_state_controller_impl2.h" |
| 59 #include "ash/wm/stacking_controller.h" | |
| 60 #include "ash/wm/system_gesture_event_filter.h" | 59 #include "ash/wm/system_gesture_event_filter.h" |
| 61 #include "ash/wm/system_modal_container_event_filter.h" | 60 #include "ash/wm/system_modal_container_event_filter.h" |
| 62 #include "ash/wm/system_modal_container_layout_manager.h" | 61 #include "ash/wm/system_modal_container_layout_manager.h" |
| 63 #include "ash/wm/user_activity_detector.h" | 62 #include "ash/wm/user_activity_detector.h" |
| 64 #include "ash/wm/video_detector.h" | 63 #include "ash/wm/video_detector.h" |
| 65 #include "ash/wm/window_animations.h" | 64 #include "ash/wm/window_animations.h" |
| 66 #include "ash/wm/window_cycle_controller.h" | 65 #include "ash/wm/window_cycle_controller.h" |
| 67 #include "ash/wm/window_properties.h" | 66 #include "ash/wm/window_properties.h" |
| 68 #include "ash/wm/window_util.h" | 67 #include "ash/wm/window_util.h" |
| 69 #include "ash/wm/workspace_controller.h" | 68 #include "ash/wm/workspace_controller.h" |
| 70 #include "base/bind.h" | 69 #include "base/bind.h" |
| 71 #include "base/command_line.h" | 70 #include "base/command_line.h" |
| 72 #include "base/debug/leak_annotations.h" | 71 #include "base/debug/leak_annotations.h" |
| 73 #include "ui/aura/client/aura_constants.h" | 72 #include "ui/aura/client/aura_constants.h" |
| 74 #include "ui/aura/client/stacking_client.h" | |
| 75 #include "ui/aura/client/user_action_client.h" | 73 #include "ui/aura/client/user_action_client.h" |
| 76 #include "ui/aura/env.h" | 74 #include "ui/aura/env.h" |
| 77 #include "ui/aura/focus_manager.h" | 75 #include "ui/aura/focus_manager.h" |
| 78 #include "ui/aura/layout_manager.h" | 76 #include "ui/aura/layout_manager.h" |
| 79 #include "ui/aura/root_window.h" | 77 #include "ui/aura/root_window.h" |
| 80 #include "ui/aura/window.h" | 78 #include "ui/aura/window.h" |
| 81 #include "ui/base/ui_base_switches.h" | 79 #include "ui/base/ui_base_switches.h" |
| 82 #include "ui/compositor/layer.h" | 80 #include "ui/compositor/layer.h" |
| 83 #include "ui/compositor/layer_animator.h" | 81 #include "ui/compositor/layer_animator.h" |
| 84 #include "ui/gfx/display.h" | 82 #include "ui/gfx/display.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 touch_observer_hud_.reset(new internal::TouchObserverHUD); | 493 touch_observer_hud_.reset(new internal::TouchObserverHUD); |
| 496 AddPreTargetHandler(touch_observer_hud_.get()); | 494 AddPreTargetHandler(touch_observer_hud_.get()); |
| 497 } | 495 } |
| 498 | 496 |
| 499 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); | 497 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); |
| 500 AddPreTargetHandler(mouse_cursor_filter_.get()); | 498 AddPreTargetHandler(mouse_cursor_filter_.get()); |
| 501 | 499 |
| 502 // Create Controllers that may need root window. | 500 // Create Controllers that may need root window. |
| 503 // TODO(oshima): Move as many controllers before creating | 501 // TODO(oshima): Move as many controllers before creating |
| 504 // RootWindowController as possible. | 502 // RootWindowController as possible. |
| 505 stacking_client_.reset(delegate_->CreateStackingClient()); | |
| 506 if (stacking_client_.get()) | |
| 507 aura::client::SetStackingClient(stacking_client_.get()); | |
| 508 visibility_controller_.reset(new AshVisibilityController); | 503 visibility_controller_.reset(new AshVisibilityController); |
| 509 drag_drop_controller_.reset(new internal::DragDropController); | 504 drag_drop_controller_.reset(new internal::DragDropController); |
| 510 user_action_client_.reset(delegate_->CreateUserActionClient()); | 505 user_action_client_.reset(delegate_->CreateUserActionClient()); |
| 511 window_modality_controller_.reset( | 506 window_modality_controller_.reset( |
| 512 new views::corewm::WindowModalityController); | 507 new views::corewm::WindowModalityController); |
| 513 AddPreTargetHandler(window_modality_controller_.get()); | 508 AddPreTargetHandler(window_modality_controller_.get()); |
| 514 | 509 |
| 515 magnification_controller_.reset( | 510 magnification_controller_.reset( |
| 516 MagnificationController::CreateInstance()); | 511 MagnificationController::CreateInstance()); |
| 517 | 512 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 root->ShowRootWindow(); | 823 root->ShowRootWindow(); |
| 829 // Activate new root for testing. | 824 // Activate new root for testing. |
| 830 active_root_window_ = root; | 825 active_root_window_ = root; |
| 831 } | 826 } |
| 832 | 827 |
| 833 void Shell::DoInitialWorkspaceAnimation() { | 828 void Shell::DoInitialWorkspaceAnimation() { |
| 834 return GetPrimaryRootWindowController()->workspace_controller()-> | 829 return GetPrimaryRootWindowController()->workspace_controller()-> |
| 835 DoInitialAnimation(); | 830 DoInitialAnimation(); |
| 836 } | 831 } |
| 837 | 832 |
| 838 aura::client::StackingClient* Shell::stacking_client() { | |
| 839 return stacking_client_.get(); | |
| 840 } | |
| 841 | |
| 842 void Shell::InitRootWindowController( | 833 void Shell::InitRootWindowController( |
| 843 internal::RootWindowController* controller) { | 834 internal::RootWindowController* controller) { |
| 844 aura::RootWindow* root_window = controller->root_window(); | 835 aura::RootWindow* root_window = controller->root_window(); |
| 845 DCHECK(activation_client_); | 836 DCHECK(activation_client_); |
| 846 DCHECK(visibility_controller_.get()); | 837 DCHECK(visibility_controller_.get()); |
| 847 DCHECK(drag_drop_controller_.get()); | 838 DCHECK(drag_drop_controller_.get()); |
| 848 DCHECK(capture_controller_.get()); | 839 DCHECK(capture_controller_.get()); |
| 849 DCHECK(window_cycle_controller_.get()); | 840 DCHECK(window_cycle_controller_.get()); |
| 850 | 841 |
| 851 aura::client::SetFocusClient(root_window, focus_client_.get()); | 842 aura::client::SetFocusClient(root_window, focus_client_.get()); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 //////////////////////////////////////////////////////////////////////////////// | 914 //////////////////////////////////////////////////////////////////////////////// |
| 924 // Shell, aura::client::ActivationChangeObserver implementation: | 915 // Shell, aura::client::ActivationChangeObserver implementation: |
| 925 | 916 |
| 926 void Shell::OnWindowActivated(aura::Window* gained_active, | 917 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 927 aura::Window* lost_active) { | 918 aura::Window* lost_active) { |
| 928 if (gained_active) | 919 if (gained_active) |
| 929 active_root_window_ = gained_active->GetRootWindow(); | 920 active_root_window_ = gained_active->GetRootWindow(); |
| 930 } | 921 } |
| 931 | 922 |
| 932 } // namespace ash | 923 } // namespace ash |
| OLD | NEW |