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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 // Destroy all child windows including widgets. | 532 // Destroy all child windows including widgets. |
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. |
542 #if defined(OS_CHROMEOS) | |
James Cook
2016/09/16 18:13:31
ditto, unless the order really matters
sammiequon
2016/09/16 19:21:04
Done.
| |
543 laser_pointer_controller_.reset(); | |
544 #endif | |
541 magnification_controller_.reset(); | 545 magnification_controller_.reset(); |
546 #if defined(OS_CHROMEOS) | |
542 partial_magnification_controller_.reset(); | 547 partial_magnification_controller_.reset(); |
James Cook
2016/09/16 18:13:31
optional: If partial_magnification_controller is g
sammiequon
2016/09/16 19:21:04
I don't think it should give much troubles, I prob
| |
548 #endif | |
543 tooltip_controller_.reset(); | 549 tooltip_controller_.reset(); |
544 event_client_.reset(); | 550 event_client_.reset(); |
545 toplevel_window_event_handler_.reset(); | 551 toplevel_window_event_handler_.reset(); |
546 visibility_controller_.reset(); | 552 visibility_controller_.reset(); |
547 | 553 |
548 power_button_controller_.reset(); | 554 power_button_controller_.reset(); |
549 lock_state_controller_.reset(); | 555 lock_state_controller_.reset(); |
550 | 556 |
551 screen_pinning_controller_.reset(); | 557 screen_pinning_controller_.reset(); |
552 | 558 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
776 // before events are consumed elsewhere. | 782 // before events are consumed elsewhere. |
777 stylus_metrics_recorder_.reset(new StylusMetricsRecorder()); | 783 stylus_metrics_recorder_.reset(new StylusMetricsRecorder()); |
778 PrependPreTargetHandler(stylus_metrics_recorder_.get()); | 784 PrependPreTargetHandler(stylus_metrics_recorder_.get()); |
779 #endif | 785 #endif |
780 | 786 |
781 // Create Controllers that may need root window. | 787 // Create Controllers that may need root window. |
782 // TODO(oshima): Move as many controllers before creating | 788 // TODO(oshima): Move as many controllers before creating |
783 // RootWindowController as possible. | 789 // RootWindowController as possible. |
784 visibility_controller_.reset(new AshVisibilityController); | 790 visibility_controller_.reset(new AshVisibilityController); |
785 | 791 |
792 #if defined(OS_CHROMEOS) | |
793 laser_pointer_controller_.reset(new LaserPointerController()); | |
794 #endif | |
795 | |
786 magnification_controller_.reset(MagnificationController::CreateInstance()); | 796 magnification_controller_.reset(MagnificationController::CreateInstance()); |
787 wm_shell_->CreateMruWindowTracker(); | 797 wm_shell_->CreateMruWindowTracker(); |
788 | 798 |
799 #if defined(OS_CHROMEOS) | |
789 partial_magnification_controller_.reset(new PartialMagnificationController()); | 800 partial_magnification_controller_.reset(new PartialMagnificationController()); |
801 #endif | |
790 | 802 |
791 autoclick_controller_.reset(AutoclickController::CreateInstance()); | 803 autoclick_controller_.reset(AutoclickController::CreateInstance()); |
792 | 804 |
793 high_contrast_controller_.reset(new HighContrastController); | 805 high_contrast_controller_.reset(new HighContrastController); |
794 video_detector_.reset(new VideoDetector); | 806 video_detector_.reset(new VideoDetector); |
795 | 807 |
796 tooltip_controller_.reset(new views::corewm::TooltipController( | 808 tooltip_controller_.reset(new views::corewm::TooltipController( |
797 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); | 809 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); |
798 AddPreTargetHandler(tooltip_controller_.get()); | 810 AddPreTargetHandler(tooltip_controller_.get()); |
799 | 811 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
931 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 943 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
932 return std::unique_ptr<ui::EventTargetIterator>(); | 944 return std::unique_ptr<ui::EventTargetIterator>(); |
933 } | 945 } |
934 | 946 |
935 ui::EventTargeter* Shell::GetEventTargeter() { | 947 ui::EventTargeter* Shell::GetEventTargeter() { |
936 NOTREACHED(); | 948 NOTREACHED(); |
937 return nullptr; | 949 return nullptr; |
938 } | 950 } |
939 | 951 |
940 } // namespace ash | 952 } // namespace ash |
OLD | NEW |