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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 lock_background_container->AddChild(mouse_event_target_.get()); | 725 lock_background_container->AddChild(mouse_event_target_.get()); |
727 mouse_event_target_->Show(); | 726 mouse_event_target_->Show(); |
728 } | 727 } |
729 | 728 |
730 // Create Docked windows layout manager | 729 // Create Docked windows layout manager |
731 aura::Window* docked_container = GetContainer( | 730 aura::Window* docked_container = GetContainer( |
732 internal::kShellWindowId_DockedContainer); | 731 internal::kShellWindowId_DockedContainer); |
733 docked_layout_manager_ = | 732 docked_layout_manager_ = |
734 new internal::DockedWindowLayoutManager(docked_container, | 733 new internal::DockedWindowLayoutManager(docked_container, |
735 workspace_controller()); | 734 workspace_controller()); |
736 docked_container_handler_.reset( | |
737 new ToplevelWindowEventHandler(docked_container)); | |
738 docked_container->SetLayoutManager(docked_layout_manager_); | 735 docked_container->SetLayoutManager(docked_layout_manager_); |
739 | 736 |
740 // Create Panel layout manager | 737 // Create Panel layout manager |
741 aura::Window* panel_container = GetContainer( | 738 aura::Window* panel_container = GetContainer( |
742 internal::kShellWindowId_PanelContainer); | 739 internal::kShellWindowId_PanelContainer); |
743 panel_layout_manager_ = | 740 panel_layout_manager_ = |
744 new internal::PanelLayoutManager(panel_container); | 741 new internal::PanelLayoutManager(panel_container); |
745 panel_container_handler_.reset( | |
746 new PanelWindowEventHandler(panel_container)); | |
747 panel_container->SetLayoutManager(panel_layout_manager_); | 742 panel_container->SetLayoutManager(panel_layout_manager_); |
| 743 panel_container_handler_.reset(new PanelWindowEventHandler); |
| 744 panel_container->AddPreTargetHandler(panel_container_handler_.get()); |
748 } | 745 } |
749 | 746 |
750 void RootWindowController::InitTouchHuds() { | 747 void RootWindowController::InitTouchHuds() { |
751 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 748 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
752 if (command_line->HasSwitch(switches::kAshTouchHud)) | 749 if (command_line->HasSwitch(switches::kAshTouchHud)) |
753 set_touch_hud_debug(new TouchHudDebug(root_window())); | 750 set_touch_hud_debug(new TouchHudDebug(root_window())); |
754 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) | 751 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) |
755 EnableTouchHudProjection(); | 752 EnableTouchHudProjection(); |
756 } | 753 } |
757 | 754 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 kShellWindowId_DefaultContainer, | 822 kShellWindowId_DefaultContainer, |
826 "DefaultContainer", | 823 "DefaultContainer", |
827 non_lock_screen_containers); | 824 non_lock_screen_containers); |
828 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); | 825 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); |
829 SetUsesScreenCoordinates(default_container); | 826 SetUsesScreenCoordinates(default_container); |
830 | 827 |
831 aura::Window* always_on_top_container = CreateContainer( | 828 aura::Window* always_on_top_container = CreateContainer( |
832 kShellWindowId_AlwaysOnTopContainer, | 829 kShellWindowId_AlwaysOnTopContainer, |
833 "AlwaysOnTopContainer", | 830 "AlwaysOnTopContainer", |
834 non_lock_screen_containers); | 831 non_lock_screen_containers); |
835 always_on_top_container_handler_.reset( | |
836 new ToplevelWindowEventHandler(always_on_top_container)); | |
837 views::corewm::SetChildWindowVisibilityChangesAnimated( | 832 views::corewm::SetChildWindowVisibilityChangesAnimated( |
838 always_on_top_container); | 833 always_on_top_container); |
839 SetUsesScreenCoordinates(always_on_top_container); | 834 SetUsesScreenCoordinates(always_on_top_container); |
840 | 835 |
841 aura::Window* docked_container = CreateContainer( | 836 aura::Window* docked_container = CreateContainer( |
842 kShellWindowId_DockedContainer, | 837 kShellWindowId_DockedContainer, |
843 "DockedContainer", | 838 "DockedContainer", |
844 non_lock_screen_containers); | 839 non_lock_screen_containers); |
845 views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); | 840 views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); |
846 SetUsesScreenCoordinates(docked_container); | 841 SetUsesScreenCoordinates(docked_container); |
(...skipping 21 matching lines...) Expand all Loading... |
868 aura::Window* app_list_container = | 863 aura::Window* app_list_container = |
869 CreateContainer(kShellWindowId_AppListContainer, | 864 CreateContainer(kShellWindowId_AppListContainer, |
870 "AppListContainer", | 865 "AppListContainer", |
871 non_lock_screen_containers); | 866 non_lock_screen_containers); |
872 SetUsesScreenCoordinates(app_list_container); | 867 SetUsesScreenCoordinates(app_list_container); |
873 | 868 |
874 aura::Window* modal_container = CreateContainer( | 869 aura::Window* modal_container = CreateContainer( |
875 kShellWindowId_SystemModalContainer, | 870 kShellWindowId_SystemModalContainer, |
876 "SystemModalContainer", | 871 "SystemModalContainer", |
877 non_lock_screen_containers); | 872 non_lock_screen_containers); |
878 modal_container_handler_.reset( | |
879 new ToplevelWindowEventHandler(modal_container)); | |
880 modal_container->SetLayoutManager( | 873 modal_container->SetLayoutManager( |
881 new SystemModalContainerLayoutManager(modal_container)); | 874 new SystemModalContainerLayoutManager(modal_container)); |
882 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); | 875 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); |
883 SetUsesScreenCoordinates(modal_container); | 876 SetUsesScreenCoordinates(modal_container); |
884 | 877 |
885 aura::Window* input_method_container = CreateContainer( | 878 aura::Window* input_method_container = CreateContainer( |
886 kShellWindowId_InputMethodContainer, | 879 kShellWindowId_InputMethodContainer, |
887 "InputMethodContainer", | 880 "InputMethodContainer", |
888 non_lock_screen_containers); | 881 non_lock_screen_containers); |
889 views::corewm::SetChildWindowVisibilityChangesAnimated( | 882 views::corewm::SetChildWindowVisibilityChangesAnimated( |
890 input_method_container); | 883 input_method_container); |
891 SetUsesScreenCoordinates(input_method_container); | 884 SetUsesScreenCoordinates(input_method_container); |
892 | 885 |
893 // TODO(beng): Figure out if we can make this use | 886 // TODO(beng): Figure out if we can make this use |
894 // SystemModalContainerEventFilter instead of stops_event_propagation. | 887 // SystemModalContainerEventFilter instead of stops_event_propagation. |
895 aura::Window* lock_container = CreateContainer( | 888 aura::Window* lock_container = CreateContainer( |
896 kShellWindowId_LockScreenContainer, | 889 kShellWindowId_LockScreenContainer, |
897 "LockScreenContainer", | 890 "LockScreenContainer", |
898 lock_screen_containers); | 891 lock_screen_containers); |
899 lock_container->SetLayoutManager( | 892 lock_container->SetLayoutManager( |
900 new BaseLayoutManager(root_window)); | 893 new BaseLayoutManager(root_window)); |
901 SetUsesScreenCoordinates(lock_container); | 894 SetUsesScreenCoordinates(lock_container); |
902 // TODO(beng): stopsevents | 895 // TODO(beng): stopsevents |
903 | 896 |
904 aura::Window* lock_modal_container = CreateContainer( | 897 aura::Window* lock_modal_container = CreateContainer( |
905 kShellWindowId_LockSystemModalContainer, | 898 kShellWindowId_LockSystemModalContainer, |
906 "LockSystemModalContainer", | 899 "LockSystemModalContainer", |
907 lock_screen_containers); | 900 lock_screen_containers); |
908 lock_modal_container_handler_.reset( | |
909 new ToplevelWindowEventHandler(lock_modal_container)); | |
910 lock_modal_container->SetLayoutManager( | 901 lock_modal_container->SetLayoutManager( |
911 new SystemModalContainerLayoutManager(lock_modal_container)); | 902 new SystemModalContainerLayoutManager(lock_modal_container)); |
912 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); | 903 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); |
913 SetUsesScreenCoordinates(lock_modal_container); | 904 SetUsesScreenCoordinates(lock_modal_container); |
914 | 905 |
915 aura::Window* status_container = | 906 aura::Window* status_container = |
916 CreateContainer(kShellWindowId_StatusContainer, | 907 CreateContainer(kShellWindowId_StatusContainer, |
917 "StatusContainer", | 908 "StatusContainer", |
918 lock_screen_related_containers); | 909 lock_screen_related_containers); |
919 SetUsesScreenCoordinates(status_container); | 910 SetUsesScreenCoordinates(status_container); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 DisableTouchHudProjection(); | 966 DisableTouchHudProjection(); |
976 } | 967 } |
977 | 968 |
978 RootWindowController* GetRootWindowController( | 969 RootWindowController* GetRootWindowController( |
979 const aura::Window* root_window) { | 970 const aura::Window* root_window) { |
980 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 971 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
981 } | 972 } |
982 | 973 |
983 } // namespace internal | 974 } // namespace internal |
984 } // namespace ash | 975 } // namespace ash |
OLD | NEW |