| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 lock_background_container->AddChild(mouse_event_target_.get()); | 693 lock_background_container->AddChild(mouse_event_target_.get()); |
| 695 mouse_event_target_->Show(); | 694 mouse_event_target_->Show(); |
| 696 } | 695 } |
| 697 | 696 |
| 698 // Create Docked windows layout manager | 697 // Create Docked windows layout manager |
| 699 aura::Window* docked_container = GetContainer( | 698 aura::Window* docked_container = GetContainer( |
| 700 internal::kShellWindowId_DockedContainer); | 699 internal::kShellWindowId_DockedContainer); |
| 701 docked_layout_manager_ = | 700 docked_layout_manager_ = |
| 702 new internal::DockedWindowLayoutManager(docked_container, | 701 new internal::DockedWindowLayoutManager(docked_container, |
| 703 workspace_controller()); | 702 workspace_controller()); |
| 704 docked_container_handler_.reset( | |
| 705 new ToplevelWindowEventHandler(docked_container)); | |
| 706 docked_container->SetLayoutManager(docked_layout_manager_); | 703 docked_container->SetLayoutManager(docked_layout_manager_); |
| 707 | 704 |
| 708 // Create Panel layout manager | 705 // Create Panel layout manager |
| 709 aura::Window* panel_container = GetContainer( | 706 aura::Window* panel_container = GetContainer( |
| 710 internal::kShellWindowId_PanelContainer); | 707 internal::kShellWindowId_PanelContainer); |
| 711 panel_layout_manager_ = | 708 panel_layout_manager_ = |
| 712 new internal::PanelLayoutManager(panel_container); | 709 new internal::PanelLayoutManager(panel_container); |
| 713 panel_container_handler_.reset( | |
| 714 new PanelWindowEventHandler(panel_container)); | |
| 715 panel_container->SetLayoutManager(panel_layout_manager_); | 710 panel_container->SetLayoutManager(panel_layout_manager_); |
| 711 panel_container_handler_.reset(new PanelWindowEventHandler); |
| 712 panel_container->AddPreTargetHandler(panel_container_handler_.get()); |
| 716 } | 713 } |
| 717 | 714 |
| 718 void RootWindowController::InitTouchHuds() { | 715 void RootWindowController::InitTouchHuds() { |
| 719 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 716 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 720 if (command_line->HasSwitch(switches::kAshTouchHud)) | 717 if (command_line->HasSwitch(switches::kAshTouchHud)) |
| 721 set_touch_hud_debug(new TouchHudDebug(root_window())); | 718 set_touch_hud_debug(new TouchHudDebug(root_window())); |
| 722 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) | 719 if (Shell::GetInstance()->is_touch_hud_projection_enabled()) |
| 723 EnableTouchHudProjection(); | 720 EnableTouchHudProjection(); |
| 724 } | 721 } |
| 725 | 722 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 kShellWindowId_DefaultContainer, | 790 kShellWindowId_DefaultContainer, |
| 794 "DefaultContainer", | 791 "DefaultContainer", |
| 795 non_lock_screen_containers); | 792 non_lock_screen_containers); |
| 796 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); | 793 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); |
| 797 SetUsesScreenCoordinates(default_container); | 794 SetUsesScreenCoordinates(default_container); |
| 798 | 795 |
| 799 aura::Window* always_on_top_container = CreateContainer( | 796 aura::Window* always_on_top_container = CreateContainer( |
| 800 kShellWindowId_AlwaysOnTopContainer, | 797 kShellWindowId_AlwaysOnTopContainer, |
| 801 "AlwaysOnTopContainer", | 798 "AlwaysOnTopContainer", |
| 802 non_lock_screen_containers); | 799 non_lock_screen_containers); |
| 803 always_on_top_container_handler_.reset( | |
| 804 new ToplevelWindowEventHandler(always_on_top_container)); | |
| 805 views::corewm::SetChildWindowVisibilityChangesAnimated( | 800 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 806 always_on_top_container); | 801 always_on_top_container); |
| 807 SetUsesScreenCoordinates(always_on_top_container); | 802 SetUsesScreenCoordinates(always_on_top_container); |
| 808 | 803 |
| 809 aura::Window* docked_container = CreateContainer( | 804 aura::Window* docked_container = CreateContainer( |
| 810 kShellWindowId_DockedContainer, | 805 kShellWindowId_DockedContainer, |
| 811 "DockedContainer", | 806 "DockedContainer", |
| 812 non_lock_screen_containers); | 807 non_lock_screen_containers); |
| 813 views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); | 808 views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); |
| 814 SetUsesScreenCoordinates(docked_container); | 809 SetUsesScreenCoordinates(docked_container); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 836 aura::Window* app_list_container = | 831 aura::Window* app_list_container = |
| 837 CreateContainer(kShellWindowId_AppListContainer, | 832 CreateContainer(kShellWindowId_AppListContainer, |
| 838 "AppListContainer", | 833 "AppListContainer", |
| 839 non_lock_screen_containers); | 834 non_lock_screen_containers); |
| 840 SetUsesScreenCoordinates(app_list_container); | 835 SetUsesScreenCoordinates(app_list_container); |
| 841 | 836 |
| 842 aura::Window* modal_container = CreateContainer( | 837 aura::Window* modal_container = CreateContainer( |
| 843 kShellWindowId_SystemModalContainer, | 838 kShellWindowId_SystemModalContainer, |
| 844 "SystemModalContainer", | 839 "SystemModalContainer", |
| 845 non_lock_screen_containers); | 840 non_lock_screen_containers); |
| 846 modal_container_handler_.reset( | |
| 847 new ToplevelWindowEventHandler(modal_container)); | |
| 848 modal_container->SetLayoutManager( | 841 modal_container->SetLayoutManager( |
| 849 new SystemModalContainerLayoutManager(modal_container)); | 842 new SystemModalContainerLayoutManager(modal_container)); |
| 850 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); | 843 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); |
| 851 SetUsesScreenCoordinates(modal_container); | 844 SetUsesScreenCoordinates(modal_container); |
| 852 | 845 |
| 853 aura::Window* input_method_container = CreateContainer( | 846 aura::Window* input_method_container = CreateContainer( |
| 854 kShellWindowId_InputMethodContainer, | 847 kShellWindowId_InputMethodContainer, |
| 855 "InputMethodContainer", | 848 "InputMethodContainer", |
| 856 non_lock_screen_containers); | 849 non_lock_screen_containers); |
| 857 views::corewm::SetChildWindowVisibilityChangesAnimated( | 850 views::corewm::SetChildWindowVisibilityChangesAnimated( |
| 858 input_method_container); | 851 input_method_container); |
| 859 SetUsesScreenCoordinates(input_method_container); | 852 SetUsesScreenCoordinates(input_method_container); |
| 860 | 853 |
| 861 // TODO(beng): Figure out if we can make this use | 854 // TODO(beng): Figure out if we can make this use |
| 862 // SystemModalContainerEventFilter instead of stops_event_propagation. | 855 // SystemModalContainerEventFilter instead of stops_event_propagation. |
| 863 aura::Window* lock_container = CreateContainer( | 856 aura::Window* lock_container = CreateContainer( |
| 864 kShellWindowId_LockScreenContainer, | 857 kShellWindowId_LockScreenContainer, |
| 865 "LockScreenContainer", | 858 "LockScreenContainer", |
| 866 lock_screen_containers); | 859 lock_screen_containers); |
| 867 lock_container->SetLayoutManager( | 860 lock_container->SetLayoutManager( |
| 868 new BaseLayoutManager(root_window)); | 861 new BaseLayoutManager(root_window)); |
| 869 SetUsesScreenCoordinates(lock_container); | 862 SetUsesScreenCoordinates(lock_container); |
| 870 // TODO(beng): stopsevents | 863 // TODO(beng): stopsevents |
| 871 | 864 |
| 872 aura::Window* lock_modal_container = CreateContainer( | 865 aura::Window* lock_modal_container = CreateContainer( |
| 873 kShellWindowId_LockSystemModalContainer, | 866 kShellWindowId_LockSystemModalContainer, |
| 874 "LockSystemModalContainer", | 867 "LockSystemModalContainer", |
| 875 lock_screen_containers); | 868 lock_screen_containers); |
| 876 lock_modal_container_handler_.reset( | |
| 877 new ToplevelWindowEventHandler(lock_modal_container)); | |
| 878 lock_modal_container->SetLayoutManager( | 869 lock_modal_container->SetLayoutManager( |
| 879 new SystemModalContainerLayoutManager(lock_modal_container)); | 870 new SystemModalContainerLayoutManager(lock_modal_container)); |
| 880 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); | 871 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); |
| 881 SetUsesScreenCoordinates(lock_modal_container); | 872 SetUsesScreenCoordinates(lock_modal_container); |
| 882 | 873 |
| 883 aura::Window* status_container = | 874 aura::Window* status_container = |
| 884 CreateContainer(kShellWindowId_StatusContainer, | 875 CreateContainer(kShellWindowId_StatusContainer, |
| 885 "StatusContainer", | 876 "StatusContainer", |
| 886 lock_screen_related_containers); | 877 lock_screen_related_containers); |
| 887 SetUsesScreenCoordinates(status_container); | 878 SetUsesScreenCoordinates(status_container); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 DisableTouchHudProjection(); | 934 DisableTouchHudProjection(); |
| 944 } | 935 } |
| 945 | 936 |
| 946 RootWindowController* GetRootWindowController( | 937 RootWindowController* GetRootWindowController( |
| 947 const aura::Window* root_window) { | 938 const aura::Window* root_window) { |
| 948 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 939 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 949 } | 940 } |
| 950 | 941 |
| 951 } // namespace internal | 942 } // namespace internal |
| 952 } // namespace ash | 943 } // namespace ash |
| OLD | NEW |