Chromium Code Reviews| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 #include "ash/display/event_transformation_handler.h" | 46 #include "ash/display/event_transformation_handler.h" |
| 47 #include "ash/display/mouse_cursor_event_filter.h" | 47 #include "ash/display/mouse_cursor_event_filter.h" |
| 48 #include "ash/display/screen_ash.h" | 48 #include "ash/display/screen_ash.h" |
| 49 #include "ash/display/screen_position_controller.h" | 49 #include "ash/display/screen_position_controller.h" |
| 50 #include "ash/display/window_tree_host_manager.h" | 50 #include "ash/display/window_tree_host_manager.h" |
| 51 #include "ash/drag_drop/drag_drop_controller.h" | 51 #include "ash/drag_drop/drag_drop_controller.h" |
| 52 #include "ash/first_run/first_run_helper_impl.h" | 52 #include "ash/first_run/first_run_helper_impl.h" |
| 53 #include "ash/high_contrast/high_contrast_controller.h" | 53 #include "ash/high_contrast/high_contrast_controller.h" |
| 54 #include "ash/host/ash_window_tree_host_init_params.h" | 54 #include "ash/host/ash_window_tree_host_init_params.h" |
| 55 #include "ash/ime/input_method_event_handler.h" | 55 #include "ash/ime/input_method_event_handler.h" |
| 56 #include "ash/laser/laser_pointer_controller.h" | |
| 56 #include "ash/magnifier/magnification_controller.h" | 57 #include "ash/magnifier/magnification_controller.h" |
| 57 #include "ash/magnifier/partial_magnification_controller.h" | 58 #include "ash/magnifier/partial_magnification_controller.h" |
| 58 #include "ash/root_window_controller.h" | 59 #include "ash/root_window_controller.h" |
| 59 #include "ash/shell_init_params.h" | 60 #include "ash/shell_init_params.h" |
| 60 #include "ash/system/chromeos/screen_layout_observer.h" | 61 #include "ash/system/chromeos/screen_layout_observer.h" |
| 61 #include "ash/utility/screenshot_controller.h" | 62 #include "ash/utility/screenshot_controller.h" |
| 62 #include "ash/wm/ash_focus_rules.h" | 63 #include "ash/wm/ash_focus_rules.h" |
| 63 #include "ash/wm/ash_native_cursor_manager.h" | 64 #include "ash/wm/ash_native_cursor_manager.h" |
| 64 #include "ash/wm/event_client_impl.h" | 65 #include "ash/wm/event_client_impl.h" |
| 65 #include "ash/wm/immersive_handler_factory_ash.h" | 66 #include "ash/wm/immersive_handler_factory_ash.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 window_tree_host_manager_->CloseChildWindows(); | 533 window_tree_host_manager_->CloseChildWindows(); |
| 533 // MruWindowTracker must be destroyed after all windows have been deleted to | 534 // MruWindowTracker must be destroyed after all windows have been deleted to |
| 534 // avoid a possible crash when Shell is destroyed from a non-normal shutdown | 535 // avoid a possible crash when Shell is destroyed from a non-normal shutdown |
| 535 // path. (crbug.com/485438). | 536 // path. (crbug.com/485438). |
| 536 wm_shell_->DeleteMruWindowTracker(); | 537 wm_shell_->DeleteMruWindowTracker(); |
| 537 | 538 |
| 538 // These need a valid Shell instance to clean up properly, so explicitly | 539 // These need a valid Shell instance to clean up properly, so explicitly |
| 539 // delete them before invalidating the instance. | 540 // delete them before invalidating the instance. |
| 540 // Alphabetical. TODO(oshima): sort. | 541 // Alphabetical. TODO(oshima): sort. |
| 541 magnification_controller_.reset(); | 542 magnification_controller_.reset(); |
| 542 partial_magnification_controller_.reset(); | |
| 543 tooltip_controller_.reset(); | 543 tooltip_controller_.reset(); |
| 544 event_client_.reset(); | 544 event_client_.reset(); |
| 545 toplevel_window_event_handler_.reset(); | 545 toplevel_window_event_handler_.reset(); |
| 546 visibility_controller_.reset(); | 546 visibility_controller_.reset(); |
| 547 | 547 |
| 548 power_button_controller_.reset(); | 548 power_button_controller_.reset(); |
| 549 lock_state_controller_.reset(); | 549 lock_state_controller_.reset(); |
| 550 | 550 |
| 551 screen_pinning_controller_.reset(); | 551 screen_pinning_controller_.reset(); |
| 552 | 552 |
| 553 #if defined(OS_CHROMEOS) | 553 #if defined(OS_CHROMEOS) |
| 554 resolution_notification_controller_.reset(); | 554 resolution_notification_controller_.reset(); |
| 555 #endif | 555 #endif |
| 556 screenshot_controller_.reset(); | 556 screenshot_controller_.reset(); |
| 557 mouse_cursor_filter_.reset(); | 557 mouse_cursor_filter_.reset(); |
| 558 modality_filter_.reset(); | 558 modality_filter_.reset(); |
| 559 | 559 |
| 560 #if defined(OS_CHROMEOS) | 560 #if defined(OS_CHROMEOS) |
| 561 touch_transformer_controller_.reset(); | 561 touch_transformer_controller_.reset(); |
| 562 stylus_metrics_recorder_.reset(); | 562 stylus_metrics_recorder_.reset(); |
| 563 audio_a11y_controller_.reset(); | 563 audio_a11y_controller_.reset(); |
| 564 laser_pointer_controller_.reset(); | |
| 565 partial_magnification_controller_.reset(); | |
| 564 #endif // defined(OS_CHROMEOS) | 566 #endif // defined(OS_CHROMEOS) |
| 565 | 567 |
| 566 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 568 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
| 567 // WindowTreeHostManager before resetting |window_tree_host_manager_|, since | 569 // WindowTreeHostManager before resetting |window_tree_host_manager_|, since |
| 568 // destruction | 570 // destruction |
| 569 // of its owned RootWindowControllers relies on the value. | 571 // of its owned RootWindowControllers relies on the value. |
| 570 ScreenAsh::CreateScreenForShutdown(); | 572 ScreenAsh::CreateScreenForShutdown(); |
| 571 display_configuration_controller_.reset(); | 573 display_configuration_controller_.reset(); |
| 572 | 574 |
| 573 wm_shell_->Shutdown(); | 575 wm_shell_->Shutdown(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 776 // before events are consumed elsewhere. | 778 // before events are consumed elsewhere. |
| 777 stylus_metrics_recorder_.reset(new StylusMetricsRecorder()); | 779 stylus_metrics_recorder_.reset(new StylusMetricsRecorder()); |
| 778 PrependPreTargetHandler(stylus_metrics_recorder_.get()); | 780 PrependPreTargetHandler(stylus_metrics_recorder_.get()); |
| 779 #endif | 781 #endif |
| 780 | 782 |
| 781 // Create Controllers that may need root window. | 783 // Create Controllers that may need root window. |
| 782 // TODO(oshima): Move as many controllers before creating | 784 // TODO(oshima): Move as many controllers before creating |
| 783 // RootWindowController as possible. | 785 // RootWindowController as possible. |
| 784 visibility_controller_.reset(new AshVisibilityController); | 786 visibility_controller_.reset(new AshVisibilityController); |
| 785 | 787 |
| 788 #if defined(OS_CHROMEOS) | |
| 789 laser_pointer_controller_.reset(new LaserPointerController()); | |
|
jdufault
2016/09/16 19:58:41
We should try to keep the init order the same rela
sammiequon
2016/09/16 20:37:40
Done.
| |
| 790 #endif | |
| 791 | |
| 786 magnification_controller_.reset(MagnificationController::CreateInstance()); | 792 magnification_controller_.reset(MagnificationController::CreateInstance()); |
| 787 wm_shell_->CreateMruWindowTracker(); | 793 wm_shell_->CreateMruWindowTracker(); |
| 788 | 794 |
| 795 #if defined(OS_CHROMEOS) | |
| 789 partial_magnification_controller_.reset(new PartialMagnificationController()); | 796 partial_magnification_controller_.reset(new PartialMagnificationController()); |
| 797 #endif | |
| 790 | 798 |
| 791 autoclick_controller_.reset(AutoclickController::CreateInstance()); | 799 autoclick_controller_.reset(AutoclickController::CreateInstance()); |
| 792 | 800 |
| 793 high_contrast_controller_.reset(new HighContrastController); | 801 high_contrast_controller_.reset(new HighContrastController); |
| 794 video_detector_.reset(new VideoDetector); | 802 video_detector_.reset(new VideoDetector); |
| 795 | 803 |
| 796 tooltip_controller_.reset(new views::corewm::TooltipController( | 804 tooltip_controller_.reset(new views::corewm::TooltipController( |
| 797 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); | 805 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); |
| 798 AddPreTargetHandler(tooltip_controller_.get()); | 806 AddPreTargetHandler(tooltip_controller_.get()); |
| 799 | 807 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 931 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 939 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
| 932 return std::unique_ptr<ui::EventTargetIterator>(); | 940 return std::unique_ptr<ui::EventTargetIterator>(); |
| 933 } | 941 } |
| 934 | 942 |
| 935 ui::EventTargeter* Shell::GetEventTargeter() { | 943 ui::EventTargeter* Shell::GetEventTargeter() { |
| 936 NOTREACHED(); | 944 NOTREACHED(); |
| 937 return nullptr; | 945 return nullptr; |
| 938 } | 946 } |
| 939 | 947 |
| 940 } // namespace ash | 948 } // namespace ash |
| OLD | NEW |