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 #ifndef ASH_SHELL_H_ | 5 #ifndef ASH_SHELL_H_ |
6 #define ASH_SHELL_H_ | 6 #define ASH_SHELL_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <utility> | 9 #include <utility> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
12 #include "ash/metrics/user_metrics_recorder.h" | 13 #include "ash/metrics/user_metrics_recorder.h" |
13 #include "ash/shelf/shelf_types.h" | 14 #include "ash/shelf/shelf_types.h" |
14 #include "ash/system/user/login_status.h" | 15 #include "ash/system/user/login_status.h" |
15 #include "ash/wm/cursor_manager_chromeos.h" | 16 #include "ash/wm/cursor_manager_chromeos.h" |
16 #include "ash/wm/system_modal_container_event_filter_delegate.h" | 17 #include "ash/wm/system_modal_container_event_filter_delegate.h" |
17 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
18 #include "base/gtest_prod_util.h" | 19 #include "base/gtest_prod_util.h" |
19 #include "base/macros.h" | 20 #include "base/macros.h" |
20 #include "base/memory/scoped_ptr.h" | |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/observer_list.h" | 22 #include "base/observer_list.h" |
23 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
24 #include "ui/base/ui_base_types.h" | 24 #include "ui/base/ui_base_types.h" |
25 #include "ui/events/event_target.h" | 25 #include "ui/events/event_target.h" |
26 #include "ui/gfx/geometry/insets.h" | 26 #include "ui/gfx/geometry/insets.h" |
27 #include "ui/gfx/geometry/size.h" | 27 #include "ui/gfx/geometry/size.h" |
28 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
29 #include "ui/wm/core/cursor_manager.h" | 29 #include "ui/wm/core/cursor_manager.h" |
30 #include "ui/wm/public/activation_change_observer.h" | 30 #include "ui/wm/public/activation_change_observer.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 | 618 |
619 // Hides the shelf view if any are visible. | 619 // Hides the shelf view if any are visible. |
620 void HideShelf(); | 620 void HideShelf(); |
621 | 621 |
622 // ash::SystemModalContainerEventFilterDelegate overrides: | 622 // ash::SystemModalContainerEventFilterDelegate overrides: |
623 bool CanWindowReceiveEvents(aura::Window* window) override; | 623 bool CanWindowReceiveEvents(aura::Window* window) override; |
624 | 624 |
625 // Overridden from ui::EventTarget: | 625 // Overridden from ui::EventTarget: |
626 bool CanAcceptEvent(const ui::Event& event) override; | 626 bool CanAcceptEvent(const ui::Event& event) override; |
627 EventTarget* GetParentTarget() override; | 627 EventTarget* GetParentTarget() override; |
628 scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override; | 628 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
629 ui::EventTargeter* GetEventTargeter() override; | 629 ui::EventTargeter* GetEventTargeter() override; |
630 | 630 |
631 // Overridden from aura::client::ActivationChangeObserver: | 631 // Overridden from aura::client::ActivationChangeObserver: |
632 void OnWindowActivated( | 632 void OnWindowActivated( |
633 aura::client::ActivationChangeObserver::ActivationReason reason, | 633 aura::client::ActivationChangeObserver::ActivationReason reason, |
634 aura::Window* gained_active, | 634 aura::Window* gained_active, |
635 aura::Window* lost_active) override; | 635 aura::Window* lost_active) override; |
636 | 636 |
637 static Shell* instance_; | 637 static Shell* instance_; |
638 | 638 |
639 // If set before the Shell is initialized, the mouse cursor will be hidden | 639 // If set before the Shell is initialized, the mouse cursor will be hidden |
640 // when the screen is initially created. | 640 // when the screen is initially created. |
641 static bool initially_hide_cursor_; | 641 static bool initially_hide_cursor_; |
642 | 642 |
643 // When no explicit target display/RootWindow is given, new windows are | 643 // When no explicit target display/RootWindow is given, new windows are |
644 // created on |scoped_target_root_window_| , unless NULL in | 644 // created on |scoped_target_root_window_| , unless NULL in |
645 // which case they are created on |target_root_window_|. | 645 // which case they are created on |target_root_window_|. |
646 // |target_root_window_| never becomes NULL during the session. | 646 // |target_root_window_| never becomes NULL during the session. |
647 aura::Window* target_root_window_; | 647 aura::Window* target_root_window_; |
648 aura::Window* scoped_target_root_window_; | 648 aura::Window* scoped_target_root_window_; |
649 | 649 |
650 // The CompoundEventFilter owned by aura::Env object. | 650 // The CompoundEventFilter owned by aura::Env object. |
651 scoped_ptr< ::wm::CompoundEventFilter> env_filter_; | 651 std::unique_ptr<::wm::CompoundEventFilter> env_filter_; |
652 | 652 |
653 std::vector<WindowAndBoundsPair> to_restore_; | 653 std::vector<WindowAndBoundsPair> to_restore_; |
654 | 654 |
655 scoped_ptr<UserMetricsRecorder> user_metrics_recorder_; | 655 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_; |
656 scoped_ptr<AcceleratorController> accelerator_controller_; | 656 std::unique_ptr<AcceleratorController> accelerator_controller_; |
657 scoped_ptr<ShellDelegate> delegate_; | 657 std::unique_ptr<ShellDelegate> delegate_; |
658 scoped_ptr<SystemTrayDelegate> system_tray_delegate_; | 658 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
659 scoped_ptr<SystemTrayNotifier> system_tray_notifier_; | 659 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
660 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_; | 660 std::unique_ptr<UserWallpaperDelegate> user_wallpaper_delegate_; |
661 scoped_ptr<SessionStateDelegate> session_state_delegate_; | 661 std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
662 scoped_ptr<AccessibilityDelegate> accessibility_delegate_; | 662 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; |
663 scoped_ptr<NewWindowDelegate> new_window_delegate_; | 663 std::unique_ptr<NewWindowDelegate> new_window_delegate_; |
664 scoped_ptr<MediaDelegate> media_delegate_; | 664 std::unique_ptr<MediaDelegate> media_delegate_; |
665 scoped_ptr<ShelfDelegate> shelf_delegate_; | 665 std::unique_ptr<ShelfDelegate> shelf_delegate_; |
666 scoped_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_; | 666 std::unique_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_; |
667 scoped_ptr<ShelfWindowWatcher> shelf_window_watcher_; | 667 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_; |
668 | 668 |
669 scoped_ptr<ShelfModel> shelf_model_; | 669 std::unique_ptr<ShelfModel> shelf_model_; |
670 scoped_ptr<WindowPositioner> window_positioner_; | 670 std::unique_ptr<WindowPositioner> window_positioner_; |
671 | 671 |
672 scoped_ptr<AppListController> app_list_controller_; | 672 std::unique_ptr<AppListController> app_list_controller_; |
673 | 673 |
674 scoped_ptr<DragDropController> drag_drop_controller_; | 674 std::unique_ptr<DragDropController> drag_drop_controller_; |
675 scoped_ptr<ResizeShadowController> resize_shadow_controller_; | 675 std::unique_ptr<ResizeShadowController> resize_shadow_controller_; |
676 scoped_ptr< ::wm::ShadowController> shadow_controller_; | 676 std::unique_ptr<::wm::ShadowController> shadow_controller_; |
677 scoped_ptr< ::wm::VisibilityController> visibility_controller_; | 677 std::unique_ptr<::wm::VisibilityController> visibility_controller_; |
678 scoped_ptr< ::wm::WindowModalityController> window_modality_controller_; | 678 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_; |
679 scoped_ptr<views::corewm::TooltipController> tooltip_controller_; | 679 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_; |
680 scoped_ptr<DesktopBackgroundController> desktop_background_controller_; | 680 std::unique_ptr<DesktopBackgroundController> desktop_background_controller_; |
681 scoped_ptr<PowerButtonController> power_button_controller_; | 681 std::unique_ptr<PowerButtonController> power_button_controller_; |
682 scoped_ptr<LockStateController> lock_state_controller_; | 682 std::unique_ptr<LockStateController> lock_state_controller_; |
683 scoped_ptr<MruWindowTracker> mru_window_tracker_; | 683 std::unique_ptr<MruWindowTracker> mru_window_tracker_; |
684 scoped_ptr<ui::UserActivityDetector> user_activity_detector_; | 684 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_; |
685 scoped_ptr<VideoDetector> video_detector_; | 685 std::unique_ptr<VideoDetector> video_detector_; |
686 scoped_ptr<WindowCycleController> window_cycle_controller_; | 686 std::unique_ptr<WindowCycleController> window_cycle_controller_; |
687 scoped_ptr<WindowSelectorController> window_selector_controller_; | 687 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
688 scoped_ptr<FocusCycler> focus_cycler_; | 688 std::unique_ptr<FocusCycler> focus_cycler_; |
689 scoped_ptr<WindowTreeHostManager> window_tree_host_manager_; | 689 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_; |
690 scoped_ptr<HighContrastController> high_contrast_controller_; | 690 std::unique_ptr<HighContrastController> high_contrast_controller_; |
691 scoped_ptr<MagnificationController> magnification_controller_; | 691 std::unique_ptr<MagnificationController> magnification_controller_; |
692 scoped_ptr<PartialMagnificationController> partial_magnification_controller_; | 692 std::unique_ptr<PartialMagnificationController> |
693 scoped_ptr<AutoclickController> autoclick_controller_; | 693 partial_magnification_controller_; |
694 scoped_ptr<aura::client::FocusClient> focus_client_; | 694 std::unique_ptr<AutoclickController> autoclick_controller_; |
| 695 std::unique_ptr<aura::client::FocusClient> focus_client_; |
695 aura::client::ActivationClient* activation_client_; | 696 aura::client::ActivationClient* activation_client_; |
696 scoped_ptr<PartialScreenshotController> partial_screenshot_controller_; | 697 std::unique_ptr<PartialScreenshotController> partial_screenshot_controller_; |
697 | 698 |
698 scoped_ptr<MouseCursorEventFilter> mouse_cursor_filter_; | 699 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_; |
699 scoped_ptr<ScreenPositionController> screen_position_controller_; | 700 std::unique_ptr<ScreenPositionController> screen_position_controller_; |
700 scoped_ptr<SystemModalContainerEventFilter> modality_filter_; | 701 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_; |
701 scoped_ptr<EventClientImpl> event_client_; | 702 std::unique_ptr<EventClientImpl> event_client_; |
702 scoped_ptr<EventTransformationHandler> event_transformation_handler_; | 703 std::unique_ptr<EventTransformationHandler> event_transformation_handler_; |
703 | 704 |
704 // An event filter that pre-handles key events while the partial | 705 // An event filter that pre-handles key events while the partial |
705 // screenshot UI or the keyboard overlay is active. | 706 // screenshot UI or the keyboard overlay is active. |
706 scoped_ptr<OverlayEventFilter> overlay_filter_; | 707 std::unique_ptr<OverlayEventFilter> overlay_filter_; |
707 | 708 |
708 // An event filter for logging keyboard-related metrics. | 709 // An event filter for logging keyboard-related metrics. |
709 scoped_ptr<KeyboardUMAEventFilter> keyboard_metrics_filter_; | 710 std::unique_ptr<KeyboardUMAEventFilter> keyboard_metrics_filter_; |
710 | 711 |
711 // An event filter which handles moving and resizing windows. | 712 // An event filter which handles moving and resizing windows. |
712 scoped_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_; | 713 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_; |
713 | 714 |
714 // An event filter which handles system level gestures | 715 // An event filter which handles system level gestures |
715 scoped_ptr<SystemGestureEventFilter> system_gesture_filter_; | 716 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_; |
716 | 717 |
717 // An event filter that pre-handles global accelerators. | 718 // An event filter that pre-handles global accelerators. |
718 scoped_ptr< ::wm::AcceleratorFilter> accelerator_filter_; | 719 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_; |
719 | 720 |
720 scoped_ptr<DisplayManager> display_manager_; | 721 std::unique_ptr<DisplayManager> display_manager_; |
721 scoped_ptr<DisplayConfigurationController> display_configuration_controller_; | 722 std::unique_ptr<DisplayConfigurationController> |
| 723 display_configuration_controller_; |
722 | 724 |
723 scoped_ptr<LocaleNotificationController> locale_notification_controller_; | 725 std::unique_ptr<LocaleNotificationController> locale_notification_controller_; |
724 | 726 |
725 #if defined(OS_CHROMEOS) | 727 #if defined(OS_CHROMEOS) |
726 scoped_ptr<PowerEventObserver> power_event_observer_; | 728 std::unique_ptr<PowerEventObserver> power_event_observer_; |
727 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; | 729 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; |
728 scoped_ptr<VideoActivityNotifier> video_activity_notifier_; | 730 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_; |
729 scoped_ptr<StickyKeysController> sticky_keys_controller_; | 731 std::unique_ptr<StickyKeysController> sticky_keys_controller_; |
730 scoped_ptr<ResolutionNotificationController> | 732 std::unique_ptr<ResolutionNotificationController> |
731 resolution_notification_controller_; | 733 resolution_notification_controller_; |
732 scoped_ptr<BluetoothNotificationController> | 734 std::unique_ptr<BluetoothNotificationController> |
733 bluetooth_notification_controller_; | 735 bluetooth_notification_controller_; |
734 scoped_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 736 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
735 scoped_ptr<LastWindowClosedLogoutReminder> | 737 std::unique_ptr<LastWindowClosedLogoutReminder> |
736 last_window_closed_logout_reminder_; | 738 last_window_closed_logout_reminder_; |
737 scoped_ptr<VirtualKeyboardController> virtual_keyboard_controller_; | 739 std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_; |
738 // Controls video output device state. | 740 // Controls video output device state. |
739 scoped_ptr<ui::DisplayConfigurator> display_configurator_; | 741 std::unique_ptr<ui::DisplayConfigurator> display_configurator_; |
740 scoped_ptr<DisplayColorManager> display_color_manager_; | 742 std::unique_ptr<DisplayColorManager> display_color_manager_; |
741 scoped_ptr<DisplayErrorObserver> display_error_observer_; | 743 std::unique_ptr<DisplayErrorObserver> display_error_observer_; |
742 scoped_ptr<ProjectingObserver> projecting_observer_; | 744 std::unique_ptr<ProjectingObserver> projecting_observer_; |
743 | 745 |
744 // Listens for output changes and updates the display manager. | 746 // Listens for output changes and updates the display manager. |
745 scoped_ptr<DisplayChangeObserver> display_change_observer_; | 747 std::unique_ptr<DisplayChangeObserver> display_change_observer_; |
746 | 748 |
747 // Implements content::ScreenOrientationController for ChromeOS | 749 // Implements content::ScreenOrientationController for ChromeOS |
748 scoped_ptr<ScreenOrientationController> screen_orientation_controller_; | 750 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_; |
749 | 751 |
750 scoped_ptr<TouchTransformerController> touch_transformer_controller_; | 752 std::unique_ptr<TouchTransformerController> touch_transformer_controller_; |
751 | 753 |
752 scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_; | 754 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_; |
753 scoped_ptr<ui::EventHandler> speech_feedback_handler_; | 755 std::unique_ptr<ui::EventHandler> speech_feedback_handler_; |
754 #endif // defined(OS_CHROMEOS) | 756 #endif // defined(OS_CHROMEOS) |
755 | 757 |
756 scoped_ptr<ToastManager> toast_manager_; | 758 std::unique_ptr<ToastManager> toast_manager_; |
757 scoped_ptr<MaximizeModeController> maximize_mode_controller_; | 759 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; |
758 | 760 |
759 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a | 761 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a |
760 // pointer to vend to test code. | 762 // pointer to vend to test code. |
761 AshNativeCursorManager* native_cursor_manager_; | 763 AshNativeCursorManager* native_cursor_manager_; |
762 | 764 |
763 // Cursor may be hidden on certain key events in ChromeOS, whereas we never | 765 // Cursor may be hidden on certain key events in ChromeOS, whereas we never |
764 // hide the cursor on Windows. | 766 // hide the cursor on Windows. |
765 scoped_ptr<::wm::CursorManager> cursor_manager_; | 767 std::unique_ptr<::wm::CursorManager> cursor_manager_; |
766 | 768 |
767 base::ObserverList<ShellObserver> observers_; | 769 base::ObserverList<ShellObserver> observers_; |
768 | 770 |
769 // For testing only: simulate that a modal window is open | 771 // For testing only: simulate that a modal window is open |
770 bool simulate_modal_window_open_for_testing_; | 772 bool simulate_modal_window_open_for_testing_; |
771 | 773 |
772 bool is_touch_hud_projection_enabled_; | 774 bool is_touch_hud_projection_enabled_; |
773 | 775 |
774 // Injected content::GPUDataManager support. | 776 // Injected content::GPUDataManager support. |
775 scoped_ptr<GPUSupport> gpu_support_; | 777 std::unique_ptr<GPUSupport> gpu_support_; |
776 | 778 |
777 base::SequencedWorkerPool* blocking_pool_; | 779 base::SequencedWorkerPool* blocking_pool_; |
778 | 780 |
779 bool in_mus_ = false; | 781 bool in_mus_ = false; |
780 | 782 |
781 scoped_ptr<KeyboardUI> keyboard_ui_; | 783 std::unique_ptr<KeyboardUI> keyboard_ui_; |
782 | 784 |
783 DISALLOW_COPY_AND_ASSIGN(Shell); | 785 DISALLOW_COPY_AND_ASSIGN(Shell); |
784 }; | 786 }; |
785 | 787 |
786 } // namespace ash | 788 } // namespace ash |
787 | 789 |
788 #endif // ASH_SHELL_H_ | 790 #endif // ASH_SHELL_H_ |
OLD | NEW |