| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 AddEnvEventFilter(touch_observer_hud_.get()); | 445 AddEnvEventFilter(touch_observer_hud_.get()); |
| 445 } | 446 } |
| 446 | 447 |
| 447 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); | 448 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); |
| 448 AddEnvEventFilter(mouse_cursor_filter_.get()); | 449 AddEnvEventFilter(mouse_cursor_filter_.get()); |
| 449 | 450 |
| 450 // Create Controllers that may need root window. | 451 // Create Controllers that may need root window. |
| 451 // TODO(oshima): Move as many controllers before creating | 452 // TODO(oshima): Move as many controllers before creating |
| 452 // RootWindowController as possible. | 453 // RootWindowController as possible. |
| 453 stacking_controller_.reset(new internal::StackingController); | 454 stacking_controller_.reset(new internal::StackingController); |
| 455 #if !defined(OS_WIN) |
| 456 aura::client::SetStackingController(stacking_controller_.get()); |
| 457 #endif |
| 454 visibility_controller_.reset(new internal::VisibilityController); | 458 visibility_controller_.reset(new internal::VisibilityController); |
| 455 drag_drop_controller_.reset(new internal::DragDropController); | 459 drag_drop_controller_.reset(new internal::DragDropController); |
| 456 user_action_client_.reset(delegate_->CreateUserActionClient()); | 460 user_action_client_.reset(delegate_->CreateUserActionClient()); |
| 457 window_modality_controller_.reset(new internal::WindowModalityController); | 461 window_modality_controller_.reset(new internal::WindowModalityController); |
| 458 AddEnvEventFilter(window_modality_controller_.get()); | 462 AddEnvEventFilter(window_modality_controller_.get()); |
| 459 | 463 |
| 460 magnification_controller_.reset( | 464 magnification_controller_.reset( |
| 461 internal::MagnificationController::CreateInstance()); | 465 internal::MagnificationController::CreateInstance()); |
| 462 | 466 |
| 463 high_contrast_controller_.reset(new HighContrastController); | 467 high_contrast_controller_.reset(new HighContrastController); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 root->ShowRootWindow(); | 760 root->ShowRootWindow(); |
| 757 // Activate new root for testing. | 761 // Activate new root for testing. |
| 758 active_root_window_ = root; | 762 active_root_window_ = root; |
| 759 } | 763 } |
| 760 | 764 |
| 761 void Shell::DoInitialWorkspaceAnimation() { | 765 void Shell::DoInitialWorkspaceAnimation() { |
| 762 return GetPrimaryRootWindowController()->workspace_controller()-> | 766 return GetPrimaryRootWindowController()->workspace_controller()-> |
| 763 DoInitialAnimation(); | 767 DoInitialAnimation(); |
| 764 } | 768 } |
| 765 | 769 |
| 770 aura::client::StackingClient* Shell::stacking_client() { |
| 771 return stacking_controller_.get(); |
| 772 } |
| 773 |
| 766 void Shell::InitRootWindowController( | 774 void Shell::InitRootWindowController( |
| 767 internal::RootWindowController* controller) { | 775 internal::RootWindowController* controller) { |
| 768 aura::RootWindow* root_window = controller->root_window(); | 776 aura::RootWindow* root_window = controller->root_window(); |
| 769 DCHECK(activation_controller_.get()); | 777 DCHECK(activation_controller_.get()); |
| 770 DCHECK(visibility_controller_.get()); | 778 DCHECK(visibility_controller_.get()); |
| 771 DCHECK(drag_drop_controller_.get()); | 779 DCHECK(drag_drop_controller_.get()); |
| 772 DCHECK(capture_controller_.get()); | 780 DCHECK(capture_controller_.get()); |
| 773 DCHECK(window_cycle_controller_.get()); | 781 DCHECK(window_cycle_controller_.get()); |
| 774 | 782 |
| 775 root_window->set_focus_manager(focus_manager_.get()); | 783 root_window->set_focus_manager(focus_manager_.get()); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 | 835 |
| 828 bool Shell::CanAcceptEvents() { | 836 bool Shell::CanAcceptEvents() { |
| 829 return true; | 837 return true; |
| 830 } | 838 } |
| 831 | 839 |
| 832 ui::EventTarget* Shell::GetParentTarget() { | 840 ui::EventTarget* Shell::GetParentTarget() { |
| 833 return NULL; | 841 return NULL; |
| 834 } | 842 } |
| 835 | 843 |
| 836 } // namespace ash | 844 } // namespace ash |
| OLD | NEW |