| 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/ash_switches.h" | 11 #include "ash/ash_switches.h" |
| 11 #include "ash/desktop_background/desktop_background_controller.h" | 12 #include "ash/desktop_background/desktop_background_controller.h" |
| 12 #include "ash/desktop_background/desktop_background_resources.h" | 13 #include "ash/desktop_background/desktop_background_resources.h" |
| 13 #include "ash/desktop_background/desktop_background_view.h" | 14 #include "ash/desktop_background/desktop_background_view.h" |
| 14 #include "ash/drag_drop/drag_drop_controller.h" | 15 #include "ash/drag_drop/drag_drop_controller.h" |
| 15 #include "ash/focus_cycler.h" | 16 #include "ash/focus_cycler.h" |
| 16 #include "ash/launcher/launcher.h" | 17 #include "ash/launcher/launcher.h" |
| 17 #include "ash/magnifier/magnification_controller.h" | 18 #include "ash/magnifier/magnification_controller.h" |
| 18 #include "ash/monitor/monitor_controller.h" | 19 #include "ash/monitor/monitor_controller.h" |
| 19 #include "ash/monitor/multi_monitor_manager.h" | 20 #include "ash/monitor/multi_monitor_manager.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "ui/aura/shared/input_method_event_filter.h" | 70 #include "ui/aura/shared/input_method_event_filter.h" |
| 70 #include "ui/aura/shared/root_window_event_filter.h" | 71 #include "ui/aura/shared/root_window_event_filter.h" |
| 71 #include "ui/aura/ui_controls_aura.h" | 72 #include "ui/aura/ui_controls_aura.h" |
| 72 #include "ui/aura/window.h" | 73 #include "ui/aura/window.h" |
| 73 #include "ui/compositor/layer.h" | 74 #include "ui/compositor/layer.h" |
| 74 #include "ui/compositor/layer_animator.h" | 75 #include "ui/compositor/layer_animator.h" |
| 75 #include "ui/gfx/monitor.h" | 76 #include "ui/gfx/monitor.h" |
| 76 #include "ui/gfx/screen.h" | 77 #include "ui/gfx/screen.h" |
| 77 #include "ui/gfx/size.h" | 78 #include "ui/gfx/size.h" |
| 78 #include "ui/ui_controls/ui_controls.h" | 79 #include "ui/ui_controls/ui_controls.h" |
| 80 #include "ui/views/focus/focus_manager_factory.h" |
| 79 #include "ui/views/widget/native_widget_aura.h" | 81 #include "ui/views/widget/native_widget_aura.h" |
| 80 #include "ui/views/widget/widget.h" | 82 #include "ui/views/widget/widget.h" |
| 81 | 83 |
| 82 #if !defined(OS_MACOSX) | 84 #if !defined(OS_MACOSX) |
| 83 #include "ash/accelerators/accelerator_controller.h" | 85 #include "ash/accelerators/accelerator_controller.h" |
| 84 #include "ash/accelerators/accelerator_filter.h" | 86 #include "ash/accelerators/accelerator_filter.h" |
| 85 #include "ash/accelerators/nested_dispatcher_controller.h" | 87 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 86 #endif | 88 #endif |
| 87 | 89 |
| 88 namespace ash { | 90 namespace ash { |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 root_filter_(NULL), | 540 root_filter_(NULL), |
| 539 delegate_(delegate), | 541 delegate_(delegate), |
| 540 shelf_(NULL), | 542 shelf_(NULL), |
| 541 panel_layout_manager_(NULL), | 543 panel_layout_manager_(NULL), |
| 542 root_window_layout_(NULL) { | 544 root_window_layout_(NULL) { |
| 543 gfx::Screen::SetInstance(screen_); | 545 gfx::Screen::SetInstance(screen_); |
| 544 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); | 546 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); |
| 545 } | 547 } |
| 546 | 548 |
| 547 Shell::~Shell() { | 549 Shell::~Shell() { |
| 550 views::FocusManagerFactory::Install(NULL); |
| 551 |
| 548 RemoveRootWindowEventFilter(key_rewriter_filter_.get()); | 552 RemoveRootWindowEventFilter(key_rewriter_filter_.get()); |
| 549 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); | 553 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); |
| 550 RemoveRootWindowEventFilter(input_method_filter_.get()); | 554 RemoveRootWindowEventFilter(input_method_filter_.get()); |
| 551 RemoveRootWindowEventFilter(window_modality_controller_.get()); | 555 RemoveRootWindowEventFilter(window_modality_controller_.get()); |
| 552 RemoveRootWindowEventFilter(system_gesture_filter_.get()); | 556 RemoveRootWindowEventFilter(system_gesture_filter_.get()); |
| 553 #if !defined(OS_MACOSX) | 557 #if !defined(OS_MACOSX) |
| 554 RemoveRootWindowEventFilter(accelerator_filter_.get()); | 558 RemoveRootWindowEventFilter(accelerator_filter_.get()); |
| 555 #endif | 559 #endif |
| 556 | 560 |
| 557 // Close background widget now so that the focus manager of the | 561 // Close background widget now so that the focus manager of the |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 AddRootWindowEventFilter(tooltip_controller_.get()); | 741 AddRootWindowEventFilter(tooltip_controller_.get()); |
| 738 | 742 |
| 739 drag_drop_controller_.reset(new internal::DragDropController); | 743 drag_drop_controller_.reset(new internal::DragDropController); |
| 740 magnification_controller_.reset(new internal::MagnificationController); | 744 magnification_controller_.reset(new internal::MagnificationController); |
| 741 power_button_controller_.reset(new PowerButtonController); | 745 power_button_controller_.reset(new PowerButtonController); |
| 742 AddShellObserver(power_button_controller_.get()); | 746 AddShellObserver(power_button_controller_.get()); |
| 743 video_detector_.reset(new VideoDetector); | 747 video_detector_.reset(new VideoDetector); |
| 744 window_cycle_controller_.reset(new WindowCycleController); | 748 window_cycle_controller_.reset(new WindowCycleController); |
| 745 monitor_controller_.reset(new internal::MonitorController); | 749 monitor_controller_.reset(new internal::MonitorController); |
| 746 screen_dimmer_.reset(new internal::ScreenDimmer); | 750 screen_dimmer_.reset(new internal::ScreenDimmer); |
| 751 |
| 752 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
| 747 } | 753 } |
| 748 | 754 |
| 749 aura::Window* Shell::GetContainer(int container_id) { | 755 aura::Window* Shell::GetContainer(int container_id) { |
| 750 return const_cast<aura::Window*>( | 756 return const_cast<aura::Window*>( |
| 751 const_cast<const Shell*>(this)->GetContainer(container_id)); | 757 const_cast<const Shell*>(this)->GetContainer(container_id)); |
| 752 } | 758 } |
| 753 | 759 |
| 754 const aura::Window* Shell::GetContainer(int container_id) const { | 760 const aura::Window* Shell::GetContainer(int container_id) const { |
| 755 return GetRootWindow()->GetChildById(container_id); | 761 return GetRootWindow()->GetChildById(container_id); |
| 756 } | 762 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 panel_container->SetLayoutManager(panel_layout_manager_); | 946 panel_container->SetLayoutManager(panel_layout_manager_); |
| 941 } | 947 } |
| 942 } | 948 } |
| 943 | 949 |
| 944 void Shell::DisableWorkspaceGridLayout() { | 950 void Shell::DisableWorkspaceGridLayout() { |
| 945 if (workspace_controller_.get()) | 951 if (workspace_controller_.get()) |
| 946 workspace_controller_->workspace_manager()->set_grid_size(0); | 952 workspace_controller_->workspace_manager()->set_grid_size(0); |
| 947 } | 953 } |
| 948 | 954 |
| 949 } // namespace ash | 955 } // namespace ash |
| OLD | NEW |