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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "ash/wm/visibility_controller.h" | 59 #include "ash/wm/visibility_controller.h" |
60 #include "ash/wm/window_cycle_controller.h" | 60 #include "ash/wm/window_cycle_controller.h" |
61 #include "ash/wm/window_modality_controller.h" | 61 #include "ash/wm/window_modality_controller.h" |
62 #include "ash/wm/window_properties.h" | 62 #include "ash/wm/window_properties.h" |
63 #include "ash/wm/window_util.h" | 63 #include "ash/wm/window_util.h" |
64 #include "ash/wm/workspace_controller.h" | 64 #include "ash/wm/workspace_controller.h" |
65 #include "base/bind.h" | 65 #include "base/bind.h" |
66 #include "base/command_line.h" | 66 #include "base/command_line.h" |
67 #include "base/debug/leak_annotations.h" | 67 #include "base/debug/leak_annotations.h" |
68 #include "ui/aura/client/aura_constants.h" | 68 #include "ui/aura/client/aura_constants.h" |
| 69 #include "ui/aura/client/stacking_client.h" |
69 #include "ui/aura/client/user_action_client.h" | 70 #include "ui/aura/client/user_action_client.h" |
70 #include "ui/aura/display_manager.h" | 71 #include "ui/aura/display_manager.h" |
71 #include "ui/aura/env.h" | 72 #include "ui/aura/env.h" |
72 #include "ui/aura/focus_manager.h" | 73 #include "ui/aura/focus_manager.h" |
73 #include "ui/aura/layout_manager.h" | 74 #include "ui/aura/layout_manager.h" |
74 #include "ui/aura/root_window.h" | 75 #include "ui/aura/root_window.h" |
75 #include "ui/aura/shared/compound_event_filter.h" | 76 #include "ui/aura/shared/compound_event_filter.h" |
76 #include "ui/aura/shared/input_method_event_filter.h" | 77 #include "ui/aura/shared/input_method_event_filter.h" |
77 #include "ui/aura/ui_controls_aura.h" | 78 #include "ui/aura/ui_controls_aura.h" |
78 #include "ui/aura/window.h" | 79 #include "ui/aura/window.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 touch_observer_hud_.reset(new internal::TouchObserverHUD); | 448 touch_observer_hud_.reset(new internal::TouchObserverHUD); |
448 AddPreTargetHandler(touch_observer_hud_.get()); | 449 AddPreTargetHandler(touch_observer_hud_.get()); |
449 } | 450 } |
450 | 451 |
451 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); | 452 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); |
452 AddEnvEventFilter(mouse_cursor_filter_.get()); | 453 AddEnvEventFilter(mouse_cursor_filter_.get()); |
453 | 454 |
454 // Create Controllers that may need root window. | 455 // Create Controllers that may need root window. |
455 // TODO(oshima): Move as many controllers before creating | 456 // TODO(oshima): Move as many controllers before creating |
456 // RootWindowController as possible. | 457 // RootWindowController as possible. |
457 stacking_controller_.reset(new internal::StackingController); | 458 stacking_client_.reset(delegate_->CreateStackingClient()); |
| 459 if (stacking_client_.get()) |
| 460 aura::client::SetStackingClient(stacking_client_.get()); |
458 visibility_controller_.reset(new internal::VisibilityController); | 461 visibility_controller_.reset(new internal::VisibilityController); |
459 drag_drop_controller_.reset(new internal::DragDropController); | 462 drag_drop_controller_.reset(new internal::DragDropController); |
460 user_action_client_.reset(delegate_->CreateUserActionClient()); | 463 user_action_client_.reset(delegate_->CreateUserActionClient()); |
461 window_modality_controller_.reset(new internal::WindowModalityController); | 464 window_modality_controller_.reset(new internal::WindowModalityController); |
462 AddEnvEventFilter(window_modality_controller_.get()); | 465 AddEnvEventFilter(window_modality_controller_.get()); |
463 | 466 |
464 magnification_controller_.reset( | 467 magnification_controller_.reset( |
465 internal::MagnificationController::CreateInstance()); | 468 internal::MagnificationController::CreateInstance()); |
466 | 469 |
467 high_contrast_controller_.reset(new HighContrastController); | 470 high_contrast_controller_.reset(new HighContrastController); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 root->ShowRootWindow(); | 767 root->ShowRootWindow(); |
765 // Activate new root for testing. | 768 // Activate new root for testing. |
766 active_root_window_ = root; | 769 active_root_window_ = root; |
767 } | 770 } |
768 | 771 |
769 void Shell::DoInitialWorkspaceAnimation() { | 772 void Shell::DoInitialWorkspaceAnimation() { |
770 return GetPrimaryRootWindowController()->workspace_controller()-> | 773 return GetPrimaryRootWindowController()->workspace_controller()-> |
771 DoInitialAnimation(); | 774 DoInitialAnimation(); |
772 } | 775 } |
773 | 776 |
| 777 aura::client::StackingClient* Shell::stacking_client() { |
| 778 return stacking_client_.get(); |
| 779 } |
| 780 |
774 void Shell::InitRootWindowController( | 781 void Shell::InitRootWindowController( |
775 internal::RootWindowController* controller) { | 782 internal::RootWindowController* controller) { |
776 aura::RootWindow* root_window = controller->root_window(); | 783 aura::RootWindow* root_window = controller->root_window(); |
777 DCHECK(activation_controller_.get()); | 784 DCHECK(activation_controller_.get()); |
778 DCHECK(visibility_controller_.get()); | 785 DCHECK(visibility_controller_.get()); |
779 DCHECK(drag_drop_controller_.get()); | 786 DCHECK(drag_drop_controller_.get()); |
780 DCHECK(capture_controller_.get()); | 787 DCHECK(capture_controller_.get()); |
781 DCHECK(window_cycle_controller_.get()); | 788 DCHECK(window_cycle_controller_.get()); |
782 | 789 |
783 root_window->set_focus_manager(focus_manager_.get()); | 790 root_window->set_focus_manager(focus_manager_.get()); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 842 |
836 bool Shell::CanAcceptEvents() { | 843 bool Shell::CanAcceptEvents() { |
837 return true; | 844 return true; |
838 } | 845 } |
839 | 846 |
840 ui::EventTarget* Shell::GetParentTarget() { | 847 ui::EventTarget* Shell::GetParentTarget() { |
841 return NULL; | 848 return NULL; |
842 } | 849 } |
843 | 850 |
844 } // namespace ash | 851 } // namespace ash |
OLD | NEW |