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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 GetContainer(kShellWindowId_LockSystemModalContainer); | 792 GetContainer(kShellWindowId_LockSystemModalContainer); |
793 DCHECK(lock_modal_container); | 793 DCHECK(lock_modal_container); |
794 lock_modal_container->SetLayoutManager( | 794 lock_modal_container->SetLayoutManager( |
795 new SystemModalContainerLayoutManager(lock_modal_container)); | 795 new SystemModalContainerLayoutManager(lock_modal_container)); |
796 | 796 |
797 aura::Window* lock_container = | 797 aura::Window* lock_container = |
798 GetContainer(kShellWindowId_LockScreenContainer); | 798 GetContainer(kShellWindowId_LockScreenContainer); |
799 DCHECK(lock_container); | 799 DCHECK(lock_container); |
800 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); | 800 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); |
801 | 801 |
802 WmWindow* always_on_top_container = | 802 aura::Window* always_on_top_container = |
803 GetWmContainer(kShellWindowId_AlwaysOnTopContainer); | 803 GetContainer(kShellWindowId_AlwaysOnTopContainer); |
804 DCHECK(always_on_top_container); | 804 DCHECK(always_on_top_container); |
805 always_on_top_controller_ = | 805 always_on_top_controller_ = |
806 base::MakeUnique<AlwaysOnTopController>(always_on_top_container); | 806 base::MakeUnique<AlwaysOnTopController>(always_on_top_container); |
807 | 807 |
808 // Create Panel layout manager | 808 // Create Panel layout manager |
809 WmWindow* wm_panel_container = GetWmContainer(kShellWindowId_PanelContainer); | 809 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); |
810 panel_layout_manager_ = new PanelLayoutManager(wm_panel_container); | 810 panel_layout_manager_ = new PanelLayoutManager(panel_container); |
811 wm_panel_container->aura_window()->SetLayoutManager(panel_layout_manager_); | 811 panel_container->SetLayoutManager(panel_layout_manager_); |
812 | 812 |
813 wm::WmSnapToPixelLayoutManager::InstallOnContainers(root); | 813 wm::WmSnapToPixelLayoutManager::InstallOnContainers(root); |
814 | 814 |
815 // Make it easier to resize windows that partially overlap the shelf. Must | 815 // Make it easier to resize windows that partially overlap the shelf. Must |
816 // occur after the ShelfLayoutManager is constructed by ShelfWidget. | 816 // occur after the ShelfLayoutManager is constructed by ShelfWidget. |
817 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer); | 817 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer); |
818 WmWindow* wm_shelf_container = WmWindow::Get(shelf_container); | 818 WmWindow* wm_shelf_container = WmWindow::Get(shelf_container); |
819 shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( | 819 shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( |
820 wm_shelf_container, wm_shelf_.get())); | 820 wm_shelf_container, wm_shelf_.get())); |
821 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer); | 821 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer); |
822 WmWindow* wm_status_container = WmWindow::Get(status_container); | 822 WmWindow* wm_status_container = WmWindow::Get(status_container); |
823 status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( | 823 status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( |
824 wm_status_container, wm_shelf_.get())); | 824 wm_status_container, wm_shelf_.get())); |
825 | 825 |
826 panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>(); | 826 panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>(); |
827 GetContainer(kShellWindowId_PanelContainer) | 827 GetContainer(kShellWindowId_PanelContainer) |
828 ->AddPreTargetHandler(panel_container_handler_.get()); | 828 ->AddPreTargetHandler(panel_container_handler_.get()); |
829 | 829 |
830 // Install an AttachedPanelWindowTargeter on the panel container to make it | 830 // Install an AttachedPanelWindowTargeter on the panel container to make it |
831 // easier to correctly target shelf buttons with touch. | 831 // easier to correctly target shelf buttons with touch. |
832 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, | 832 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, |
833 -kResizeOutsideBoundsSize, | 833 -kResizeOutsideBoundsSize, |
834 -kResizeOutsideBoundsSize); | 834 -kResizeOutsideBoundsSize); |
835 gfx::Insets touch_extend = | 835 gfx::Insets touch_extend = |
836 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); | 836 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); |
837 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); | |
838 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( | 837 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
839 new AttachedPanelWindowTargeter(panel_container, mouse_extend, | 838 new AttachedPanelWindowTargeter(panel_container, mouse_extend, |
840 touch_extend, panel_layout_manager()))); | 839 touch_extend, panel_layout_manager()))); |
841 } | 840 } |
842 | 841 |
843 void RootWindowController::CreateContainers() { | 842 void RootWindowController::CreateContainers() { |
844 WmWindow* root = GetWindow(); | 843 WmWindow* root = GetWindow(); |
845 // For screen rotation animation: add a NOT_DRAWN layer in between the | 844 // For screen rotation animation: add a NOT_DRAWN layer in between the |
846 // root_window's layer and its current children so that we only need to | 845 // root_window's layer and its current children so that we only need to |
847 // initiate two LayerAnimationSequences. One for the new layers and one for | 846 // initiate two LayerAnimationSequences. One for the new layers and one for |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 EnableTouchHudProjection(); | 1081 EnableTouchHudProjection(); |
1083 else | 1082 else |
1084 DisableTouchHudProjection(); | 1083 DisableTouchHudProjection(); |
1085 } | 1084 } |
1086 | 1085 |
1087 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1086 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1088 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1087 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1089 } | 1088 } |
1090 | 1089 |
1091 } // namespace ash | 1090 } // namespace ash |
OLD | NEW |