| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "ash/wm/screen_dimmer.h" | 51 #include "ash/wm/screen_dimmer.h" |
| 52 #include "ash/wm/session_state_controller.h" | 52 #include "ash/wm/session_state_controller.h" |
| 53 #include "ash/wm/session_state_controller_impl.h" | 53 #include "ash/wm/session_state_controller_impl.h" |
| 54 #include "ash/wm/session_state_controller_impl2.h" | 54 #include "ash/wm/session_state_controller_impl2.h" |
| 55 #include "ash/wm/stacking_controller.h" | 55 #include "ash/wm/stacking_controller.h" |
| 56 #include "ash/wm/system_gesture_event_filter.h" | 56 #include "ash/wm/system_gesture_event_filter.h" |
| 57 #include "ash/wm/system_modal_container_event_filter.h" | 57 #include "ash/wm/system_modal_container_event_filter.h" |
| 58 #include "ash/wm/system_modal_container_layout_manager.h" | 58 #include "ash/wm/system_modal_container_layout_manager.h" |
| 59 #include "ash/wm/user_activity_detector.h" | 59 #include "ash/wm/user_activity_detector.h" |
| 60 #include "ash/wm/video_detector.h" | 60 #include "ash/wm/video_detector.h" |
| 61 #include "ash/wm/visibility_controller.h" | 61 #include "ash/wm/window_animations.h" |
| 62 #include "ash/wm/window_cycle_controller.h" | 62 #include "ash/wm/window_cycle_controller.h" |
| 63 #include "ash/wm/window_modality_controller.h" | 63 #include "ash/wm/window_modality_controller.h" |
| 64 #include "ash/wm/window_properties.h" | 64 #include "ash/wm/window_properties.h" |
| 65 #include "ash/wm/window_util.h" | 65 #include "ash/wm/window_util.h" |
| 66 #include "ash/wm/workspace_controller.h" | 66 #include "ash/wm/workspace_controller.h" |
| 67 #include "base/bind.h" | 67 #include "base/bind.h" |
| 68 #include "base/command_line.h" | 68 #include "base/command_line.h" |
| 69 #include "base/debug/leak_annotations.h" | 69 #include "base/debug/leak_annotations.h" |
| 70 #include "ui/aura/client/aura_constants.h" | 70 #include "ui/aura/client/aura_constants.h" |
| 71 #include "ui/aura/client/stacking_client.h" | 71 #include "ui/aura/client/stacking_client.h" |
| 72 #include "ui/aura/client/user_action_client.h" | 72 #include "ui/aura/client/user_action_client.h" |
| 73 #include "ui/aura/env.h" | 73 #include "ui/aura/env.h" |
| 74 #include "ui/aura/focus_manager.h" | 74 #include "ui/aura/focus_manager.h" |
| 75 #include "ui/aura/layout_manager.h" | 75 #include "ui/aura/layout_manager.h" |
| 76 #include "ui/aura/root_window.h" | 76 #include "ui/aura/root_window.h" |
| 77 #include "ui/aura/ui_controls_aura.h" | 77 #include "ui/aura/ui_controls_aura.h" |
| 78 #include "ui/aura/window.h" | 78 #include "ui/aura/window.h" |
| 79 #include "ui/compositor/layer.h" | 79 #include "ui/compositor/layer.h" |
| 80 #include "ui/compositor/layer_animator.h" | 80 #include "ui/compositor/layer_animator.h" |
| 81 #include "ui/gfx/display.h" | 81 #include "ui/gfx/display.h" |
| 82 #include "ui/gfx/image/image_skia.h" | 82 #include "ui/gfx/image/image_skia.h" |
| 83 #include "ui/gfx/screen.h" | 83 #include "ui/gfx/screen.h" |
| 84 #include "ui/gfx/size.h" | 84 #include "ui/gfx/size.h" |
| 85 #include "ui/ui_controls/ui_controls.h" | 85 #include "ui/ui_controls/ui_controls.h" |
| 86 #include "ui/views/corewm/compound_event_filter.h" | 86 #include "ui/views/corewm/compound_event_filter.h" |
| 87 #include "ui/views/corewm/input_method_event_filter.h" | 87 #include "ui/views/corewm/input_method_event_filter.h" |
| 88 #include "ui/views/corewm/shadow_controller.h" | 88 #include "ui/views/corewm/shadow_controller.h" |
| 89 #include "ui/views/corewm/visibility_controller.h" |
| 89 #include "ui/views/focus/focus_manager_factory.h" | 90 #include "ui/views/focus/focus_manager_factory.h" |
| 90 #include "ui/views/widget/native_widget_aura.h" | 91 #include "ui/views/widget/native_widget_aura.h" |
| 91 #include "ui/views/widget/widget.h" | 92 #include "ui/views/widget/widget.h" |
| 92 | 93 |
| 93 #if !defined(OS_MACOSX) | 94 #if !defined(OS_MACOSX) |
| 94 #include "ash/accelerators/accelerator_controller.h" | 95 #include "ash/accelerators/accelerator_controller.h" |
| 95 #include "ash/accelerators/accelerator_filter.h" | 96 #include "ash/accelerators/accelerator_filter.h" |
| 96 #include "ash/accelerators/nested_dispatcher_controller.h" | 97 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 97 #endif | 98 #endif |
| 98 | 99 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 virtual void OnWallpaperAnimationFinished() OVERRIDE { | 148 virtual void OnWallpaperAnimationFinished() OVERRIDE { |
| 148 } | 149 } |
| 149 | 150 |
| 150 virtual void OnWallpaperBootAnimationFinished() OVERRIDE { | 151 virtual void OnWallpaperBootAnimationFinished() OVERRIDE { |
| 151 } | 152 } |
| 152 | 153 |
| 153 private: | 154 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(DummyUserWallpaperDelegate); | 155 DISALLOW_COPY_AND_ASSIGN(DummyUserWallpaperDelegate); |
| 155 }; | 156 }; |
| 156 | 157 |
| 158 // A Corewm VisibilityController subclass that calls the Ash animation routine |
| 159 // so we can pick up our extended animations. See ash/wm/window_animations.h. |
| 160 class AshVisibilityController : public views::corewm::VisibilityController { |
| 161 public: |
| 162 AshVisibilityController() {} |
| 163 virtual ~AshVisibilityController() {} |
| 164 |
| 165 private: |
| 166 // Overridden from views::corewm::VisibilityController: |
| 167 virtual bool CallAnimateOnChildWindowVisibilityChanged( |
| 168 aura::Window* window, |
| 169 bool visible) OVERRIDE { |
| 170 return AnimateOnChildWindowVisibilityChanged(window, visible); |
| 171 } |
| 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(AshVisibilityController); |
| 174 }; |
| 175 |
| 157 } // namespace | 176 } // namespace |
| 158 | 177 |
| 159 // static | 178 // static |
| 160 Shell* Shell::instance_ = NULL; | 179 Shell* Shell::instance_ = NULL; |
| 161 // static | 180 // static |
| 162 bool Shell::initially_hide_cursor_ = false; | 181 bool Shell::initially_hide_cursor_ = false; |
| 163 | 182 |
| 164 //////////////////////////////////////////////////////////////////////////////// | 183 //////////////////////////////////////////////////////////////////////////////// |
| 165 // Shell::TestApi | 184 // Shell::TestApi |
| 166 | 185 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 498 |
| 480 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); | 499 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); |
| 481 AddPreTargetHandler(mouse_cursor_filter_.get()); | 500 AddPreTargetHandler(mouse_cursor_filter_.get()); |
| 482 | 501 |
| 483 // Create Controllers that may need root window. | 502 // Create Controllers that may need root window. |
| 484 // TODO(oshima): Move as many controllers before creating | 503 // TODO(oshima): Move as many controllers before creating |
| 485 // RootWindowController as possible. | 504 // RootWindowController as possible. |
| 486 stacking_client_.reset(delegate_->CreateStackingClient()); | 505 stacking_client_.reset(delegate_->CreateStackingClient()); |
| 487 if (stacking_client_.get()) | 506 if (stacking_client_.get()) |
| 488 aura::client::SetStackingClient(stacking_client_.get()); | 507 aura::client::SetStackingClient(stacking_client_.get()); |
| 489 visibility_controller_.reset(new internal::VisibilityController); | 508 visibility_controller_.reset(new AshVisibilityController); |
| 490 drag_drop_controller_.reset(new internal::DragDropController); | 509 drag_drop_controller_.reset(new internal::DragDropController); |
| 491 user_action_client_.reset(delegate_->CreateUserActionClient()); | 510 user_action_client_.reset(delegate_->CreateUserActionClient()); |
| 492 window_modality_controller_.reset(new internal::WindowModalityController); | 511 window_modality_controller_.reset(new internal::WindowModalityController); |
| 493 AddPreTargetHandler(window_modality_controller_.get()); | 512 AddPreTargetHandler(window_modality_controller_.get()); |
| 494 | 513 |
| 495 magnification_controller_.reset( | 514 magnification_controller_.reset( |
| 496 MagnificationController::CreateInstance()); | 515 MagnificationController::CreateInstance()); |
| 497 | 516 |
| 498 partial_magnification_controller_.reset( | 517 partial_magnification_controller_.reset( |
| 499 new PartialMagnificationController()); | 518 new PartialMagnificationController()); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 | 882 |
| 864 bool Shell::CanAcceptEvents() { | 883 bool Shell::CanAcceptEvents() { |
| 865 return true; | 884 return true; |
| 866 } | 885 } |
| 867 | 886 |
| 868 ui::EventTarget* Shell::GetParentTarget() { | 887 ui::EventTarget* Shell::GetParentTarget() { |
| 869 return NULL; | 888 return NULL; |
| 870 } | 889 } |
| 871 | 890 |
| 872 } // namespace ash | 891 } // namespace ash |
| OLD | NEW |