| 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 <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "ash/wm/dock/docked_window_layout_manager.h" | 34 #include "ash/wm/dock/docked_window_layout_manager.h" |
| 35 #include "ash/wm/panels/panel_layout_manager.h" | 35 #include "ash/wm/panels/panel_layout_manager.h" |
| 36 #include "ash/wm/panels/panel_window_event_handler.h" | 36 #include "ash/wm/panels/panel_window_event_handler.h" |
| 37 #include "ash/wm/root_window_layout_manager.h" | 37 #include "ash/wm/root_window_layout_manager.h" |
| 38 #include "ash/wm/screen_dimmer.h" | 38 #include "ash/wm/screen_dimmer.h" |
| 39 #include "ash/wm/solo_window_tracker.h" | 39 #include "ash/wm/solo_window_tracker.h" |
| 40 #include "ash/wm/stacking_controller.h" | 40 #include "ash/wm/stacking_controller.h" |
| 41 #include "ash/wm/status_area_layout_manager.h" | 41 #include "ash/wm/status_area_layout_manager.h" |
| 42 #include "ash/wm/system_background_controller.h" | 42 #include "ash/wm/system_background_controller.h" |
| 43 #include "ash/wm/system_modal_container_layout_manager.h" | 43 #include "ash/wm/system_modal_container_layout_manager.h" |
| 44 #include "ash/wm/toplevel_window_event_handler.h" | |
| 45 #include "ash/wm/window_properties.h" | 44 #include "ash/wm/window_properties.h" |
| 46 #include "ash/wm/window_state.h" | 45 #include "ash/wm/window_state.h" |
| 47 #include "ash/wm/window_util.h" | 46 #include "ash/wm/window_util.h" |
| 48 #include "ash/wm/workspace_controller.h" | 47 #include "ash/wm/workspace_controller.h" |
| 49 #include "base/command_line.h" | 48 #include "base/command_line.h" |
| 50 #include "base/time/time.h" | 49 #include "base/time/time.h" |
| 51 #include "ui/aura/client/aura_constants.h" | 50 #include "ui/aura/client/aura_constants.h" |
| 52 #include "ui/aura/client/drag_drop_client.h" | 51 #include "ui/aura/client/drag_drop_client.h" |
| 53 #include "ui/aura/client/tooltip_client.h" | 52 #include "ui/aura/client/tooltip_client.h" |
| 54 #include "ui/aura/root_window.h" | 53 #include "ui/aura/root_window.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 lock_background_container->AddChild(mouse_event_target_.get()); | 683 lock_background_container->AddChild(mouse_event_target_.get()); |
| 685 mouse_event_target_->Show(); | 684 mouse_event_target_->Show(); |
| 686 } | 685 } |
| 687 | 686 |
| 688 // Create Docked windows layout manager | 687 // Create Docked windows layout manager |
| 689 aura::Window* docked_container = GetContainer( | 688 aura::Window* docked_container = GetContainer( |
| 690 internal::kShellWindowId_DockedContainer); | 689 internal::kShellWindowId_DockedContainer); |
| 691 docked_layout_manager_ = | 690 docked_layout_manager_ = |
| 692 new internal::DockedWindowLayoutManager(docked_container, | 691 new internal::DockedWindowLayoutManager(docked_container, |
| 693 workspace_controller()); | 692 workspace_controller()); |
| 694 docked_container_handler_.reset( | |
| 695 new ToplevelWindowEventHandler(docked_container)); | |
| 696 docked_container->SetLayoutManager(docked_layout_manager_); | 693 docked_container->SetLayoutManager(docked_layout_manager_); |
| 697 | 694 |
| 698 // Create Panel layout manager | 695 // Create Panel layout manager |
| 699 aura::Window* panel_container = GetContainer( | 696 aura::Window* panel_container = GetContainer( |
| 700 internal::kShellWindowId_PanelContainer); | 697 internal::kShellWindowId_PanelContainer); |
| 701 panel_layout_manager_ = | 698 panel_layout_manager_ = |
| 702 new internal::PanelLayoutManager(panel_container); | 699 new internal::PanelLayoutManager(panel_container); |
| 703 panel_container_handler_.reset( | |
| 704 new PanelWindowEventHandler(panel_container)); | |
| 705 panel_container->SetLayoutManager(panel_layout_manager_); | 700 panel_container->SetLayoutManager(panel_layout_manager_); |
| 701 panel_container_handler_.reset(new PanelWindowEventHandler); |
| 702 panel_container->AddPreTargetHandler(panel_container_handler_.get()); |
| 706 } | 703 } |
| 707 | 704 |
| 708 void RootWindowController::InitTouchHuds() { | 705 void RootWindowController::InitTouchHuds() { |
| 709 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 706 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 710 if (command_line->HasSwitch(switches::kAshTouchHud)) | 707 if (command_line->HasSwitch(switches::kAshTouchHud)) |
| 711 set_touch_hud_debug(new TouchHudDebug(root_window())); | 708 set_touch_hud_debug(new TouchHudDebug(root_window())); |
| 712 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) | 709 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) |
| 713 EnableTouchHudProjection(); | 710 EnableTouchHudProjection(); |
| 714 } | 711 } |
| 715 | 712 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 kShellWindowId_DefaultContainer, | 780 kShellWindowId_DefaultContainer, |
| 784 "DefaultContainer", | 781 "DefaultContainer", |
| 785 non_lock_screen_containers); | 782 non_lock_screen_containers); |
| 786 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); | 783 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); |
| 787 SetUsesScreenCoordinates(default_container); | 784 SetUsesScreenCoordinates(default_container); |
| 788 | 785 |
| 789 aura::Window* always_on_top_container = CreateContainer( | 786 aura::Window* always_on_top_container = CreateContainer( |
| 790 kShellWindowId_AlwaysOnTopContainer, | 787 kShellWindowId_AlwaysOnTopContainer, |
| 791 "AlwaysOnTopContainer", | 788 "AlwaysOnTopContainer", |
| 792 non_lock_screen_containers); | 789 non_lock_screen_containers); |
| 793 always_on_top_container_handler_.reset( | |
| 794 new ToplevelWindowEventHandler(always_on_top_container)); | |
| 795 views::corewm::SetChildWindowVisibilityChangesAnimated( | 790 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 796 always_on_top_container); | 791 always_on_top_container); |
| 797 SetUsesScreenCoordinates(always_on_top_container); | 792 SetUsesScreenCoordinates(always_on_top_container); |
| 798 | 793 |
| 799 aura::Window* docked_container = CreateContainer( | 794 aura::Window* docked_container = CreateContainer( |
| 800 kShellWindowId_DockedContainer, | 795 kShellWindowId_DockedContainer, |
| 801 "DockedContainer", | 796 "DockedContainer", |
| 802 non_lock_screen_containers); | 797 non_lock_screen_containers); |
| 803 views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); | 798 views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); |
| 804 SetUsesScreenCoordinates(docked_container); | 799 SetUsesScreenCoordinates(docked_container); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 826 aura::Window* app_list_container = | 821 aura::Window* app_list_container = |
| 827 CreateContainer(kShellWindowId_AppListContainer, | 822 CreateContainer(kShellWindowId_AppListContainer, |
| 828 "AppListContainer", | 823 "AppListContainer", |
| 829 non_lock_screen_containers); | 824 non_lock_screen_containers); |
| 830 SetUsesScreenCoordinates(app_list_container); | 825 SetUsesScreenCoordinates(app_list_container); |
| 831 | 826 |
| 832 aura::Window* modal_container = CreateContainer( | 827 aura::Window* modal_container = CreateContainer( |
| 833 kShellWindowId_SystemModalContainer, | 828 kShellWindowId_SystemModalContainer, |
| 834 "SystemModalContainer", | 829 "SystemModalContainer", |
| 835 non_lock_screen_containers); | 830 non_lock_screen_containers); |
| 836 modal_container_handler_.reset( | |
| 837 new ToplevelWindowEventHandler(modal_container)); | |
| 838 modal_container->SetLayoutManager( | 831 modal_container->SetLayoutManager( |
| 839 new SystemModalContainerLayoutManager(modal_container)); | 832 new SystemModalContainerLayoutManager(modal_container)); |
| 840 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); | 833 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); |
| 841 SetUsesScreenCoordinates(modal_container); | 834 SetUsesScreenCoordinates(modal_container); |
| 842 | 835 |
| 843 aura::Window* input_method_container = CreateContainer( | 836 aura::Window* input_method_container = CreateContainer( |
| 844 kShellWindowId_InputMethodContainer, | 837 kShellWindowId_InputMethodContainer, |
| 845 "InputMethodContainer", | 838 "InputMethodContainer", |
| 846 non_lock_screen_containers); | 839 non_lock_screen_containers); |
| 847 views::corewm::SetChildWindowVisibilityChangesAnimated( | 840 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 848 input_method_container); | 841 input_method_container); |
| 849 SetUsesScreenCoordinates(input_method_container); | 842 SetUsesScreenCoordinates(input_method_container); |
| 850 | 843 |
| 851 // TODO(beng): Figure out if we can make this use | 844 // TODO(beng): Figure out if we can make this use |
| 852 // SystemModalContainerEventFilter instead of stops_event_propagation. | 845 // SystemModalContainerEventFilter instead of stops_event_propagation. |
| 853 aura::Window* lock_container = CreateContainer( | 846 aura::Window* lock_container = CreateContainer( |
| 854 kShellWindowId_LockScreenContainer, | 847 kShellWindowId_LockScreenContainer, |
| 855 "LockScreenContainer", | 848 "LockScreenContainer", |
| 856 lock_screen_containers); | 849 lock_screen_containers); |
| 857 lock_container->SetLayoutManager( | 850 lock_container->SetLayoutManager( |
| 858 new BaseLayoutManager(root_window)); | 851 new BaseLayoutManager(root_window)); |
| 859 SetUsesScreenCoordinates(lock_container); | 852 SetUsesScreenCoordinates(lock_container); |
| 860 // TODO(beng): stopsevents | 853 // TODO(beng): stopsevents |
| 861 | 854 |
| 862 aura::Window* lock_modal_container = CreateContainer( | 855 aura::Window* lock_modal_container = CreateContainer( |
| 863 kShellWindowId_LockSystemModalContainer, | 856 kShellWindowId_LockSystemModalContainer, |
| 864 "LockSystemModalContainer", | 857 "LockSystemModalContainer", |
| 865 lock_screen_containers); | 858 lock_screen_containers); |
| 866 lock_modal_container_handler_.reset( | |
| 867 new ToplevelWindowEventHandler(lock_modal_container)); | |
| 868 lock_modal_container->SetLayoutManager( | 859 lock_modal_container->SetLayoutManager( |
| 869 new SystemModalContainerLayoutManager(lock_modal_container)); | 860 new SystemModalContainerLayoutManager(lock_modal_container)); |
| 870 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); | 861 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); |
| 871 SetUsesScreenCoordinates(lock_modal_container); | 862 SetUsesScreenCoordinates(lock_modal_container); |
| 872 | 863 |
| 873 aura::Window* status_container = | 864 aura::Window* status_container = |
| 874 CreateContainer(kShellWindowId_StatusContainer, | 865 CreateContainer(kShellWindowId_StatusContainer, |
| 875 "StatusContainer", | 866 "StatusContainer", |
| 876 lock_screen_related_containers); | 867 lock_screen_related_containers); |
| 877 SetUsesScreenCoordinates(status_container); | 868 SetUsesScreenCoordinates(status_container); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 DisableTouchHudProjection(); | 924 DisableTouchHudProjection(); |
| 934 } | 925 } |
| 935 | 926 |
| 936 RootWindowController* GetRootWindowController( | 927 RootWindowController* GetRootWindowController( |
| 937 const aura::Window* root_window) { | 928 const aura::Window* root_window) { |
| 938 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 929 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 939 } | 930 } |
| 940 | 931 |
| 941 } // namespace internal | 932 } // namespace internal |
| 942 } // namespace ash | 933 } // namespace ash |
| OLD | NEW |