| 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/shell.h" |    5 #include "ash/shell.h" | 
|    6  |    6  | 
|    7 #include <algorithm> |    7 #include <algorithm> | 
|    8 #include <string> |    8 #include <string> | 
|    9 #include <utility> |    9 #include <utility> | 
|   10  |   10  | 
|   11 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |   11 #include "ash/accelerators/accelerator_controller_delegate_aura.h" | 
|   12 #include "ash/accelerators/accelerator_delegate.h" |   12 #include "ash/accelerators/accelerator_delegate.h" | 
|   13 #include "ash/accelerators/magnifier_key_scroller.h" |   13 #include "ash/accelerators/magnifier_key_scroller.h" | 
|   14 #include "ash/accelerators/spoken_feedback_toggler.h" |   14 #include "ash/accelerators/spoken_feedback_toggler.h" | 
|   15 #include "ash/aura/wm_shell_aura.h" |   15 #include "ash/aura/wm_shell_aura.h" | 
|   16 #include "ash/aura/wm_window_aura.h" |  | 
|   17 #include "ash/autoclick/autoclick_controller.h" |   16 #include "ash/autoclick/autoclick_controller.h" | 
|   18 #include "ash/common/accelerators/accelerator_controller.h" |   17 #include "ash/common/accelerators/accelerator_controller.h" | 
|   19 #include "ash/common/ash_constants.h" |   18 #include "ash/common/ash_constants.h" | 
|   20 #include "ash/common/frame/custom_frame_view_ash.h" |   19 #include "ash/common/frame/custom_frame_view_ash.h" | 
|   21 #include "ash/common/gpu_support.h" |   20 #include "ash/common/gpu_support.h" | 
|   22 #include "ash/common/keyboard/keyboard_ui.h" |   21 #include "ash/common/keyboard/keyboard_ui.h" | 
|   23 #include "ash/common/login_status.h" |   22 #include "ash/common/login_status.h" | 
|   24 #include "ash/common/session/session_state_delegate.h" |   23 #include "ash/common/session/session_state_delegate.h" | 
|   25 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |   24 #include "ash/common/shelf/app_list_shelf_item_delegate.h" | 
|   26 #include "ash/common/shelf/shelf_delegate.h" |   25 #include "ash/common/shelf/shelf_delegate.h" | 
|   27 #include "ash/common/shelf/shelf_item_delegate.h" |   26 #include "ash/common/shelf/shelf_item_delegate.h" | 
|   28 #include "ash/common/shelf/shelf_model.h" |   27 #include "ash/common/shelf/shelf_model.h" | 
|   29 #include "ash/common/shelf/wm_shelf.h" |   28 #include "ash/common/shelf/wm_shelf.h" | 
|   30 #include "ash/common/shell_delegate.h" |   29 #include "ash/common/shell_delegate.h" | 
|   31 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller
     .h" |   30 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller
     .h" | 
|   32 #include "ash/common/system/chromeos/power/power_status.h" |   31 #include "ash/common/system/chromeos/power/power_status.h" | 
|   33 #include "ash/common/system/status_area_widget.h" |   32 #include "ash/common/system/status_area_widget.h" | 
|   34 #include "ash/common/system/tray/system_tray_delegate.h" |   33 #include "ash/common/system/tray/system_tray_delegate.h" | 
|   35 #include "ash/common/wallpaper/wallpaper_delegate.h" |   34 #include "ash/common/wallpaper/wallpaper_delegate.h" | 
|   36 #include "ash/common/wm/container_finder.h" |   35 #include "ash/common/wm/container_finder.h" | 
|   37 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |   36 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 
|   38 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |   37 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 
|   39 #include "ash/common/wm/mru_window_tracker.h" |   38 #include "ash/common/wm/mru_window_tracker.h" | 
|   40 #include "ash/common/wm/root_window_finder.h" |   39 #include "ash/common/wm/root_window_finder.h" | 
|   41 #include "ash/common/wm/system_modal_container_layout_manager.h" |   40 #include "ash/common/wm/system_modal_container_layout_manager.h" | 
|   42 #include "ash/common/wm/window_positioner.h" |   41 #include "ash/common/wm/window_positioner.h" | 
|   43 #include "ash/common/wm/workspace_controller.h" |   42 #include "ash/common/wm/workspace_controller.h" | 
|   44 #include "ash/common/wm_shell.h" |   43 #include "ash/common/wm_shell.h" | 
 |   44 #include "ash/common/wm_window.h" | 
|   45 #include "ash/display/cursor_window_controller.h" |   45 #include "ash/display/cursor_window_controller.h" | 
|   46 #include "ash/display/display_color_manager_chromeos.h" |   46 #include "ash/display/display_color_manager_chromeos.h" | 
|   47 #include "ash/display/display_configuration_controller.h" |   47 #include "ash/display/display_configuration_controller.h" | 
|   48 #include "ash/display/display_error_observer_chromeos.h" |   48 #include "ash/display/display_error_observer_chromeos.h" | 
|   49 #include "ash/display/event_transformation_handler.h" |   49 #include "ash/display/event_transformation_handler.h" | 
|   50 #include "ash/display/mouse_cursor_event_filter.h" |   50 #include "ash/display/mouse_cursor_event_filter.h" | 
|   51 #include "ash/display/projecting_observer_chromeos.h" |   51 #include "ash/display/projecting_observer_chromeos.h" | 
|   52 #include "ash/display/resolution_notification_controller.h" |   52 #include "ash/display/resolution_notification_controller.h" | 
|   53 #include "ash/display/screen_ash.h" |   53 #include "ash/display/screen_ash.h" | 
|   54 #include "ash/display/screen_orientation_controller_chromeos.h" |   54 #include "ash/display/screen_orientation_controller_chromeos.h" | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  221  |  221  | 
|  222 // static |  222 // static | 
|  223 aura::Window* Shell::GetPrimaryRootWindow() { |  223 aura::Window* Shell::GetPrimaryRootWindow() { | 
|  224   CHECK(HasInstance()); |  224   CHECK(HasInstance()); | 
|  225   return GetInstance()->window_tree_host_manager()->GetPrimaryRootWindow(); |  225   return GetInstance()->window_tree_host_manager()->GetPrimaryRootWindow(); | 
|  226 } |  226 } | 
|  227  |  227  | 
|  228 // static |  228 // static | 
|  229 aura::Window* Shell::GetTargetRootWindow() { |  229 aura::Window* Shell::GetTargetRootWindow() { | 
|  230   CHECK(WmShell::HasInstance()); |  230   CHECK(WmShell::HasInstance()); | 
|  231   return WmWindowAura::GetAuraWindow( |  231   return WmWindow::GetAuraWindow(WmShell::Get()->GetRootWindowForNewWindows()); | 
|  232       WmShell::Get()->GetRootWindowForNewWindows()); |  | 
|  233 } |  232 } | 
|  234  |  233  | 
|  235 // static |  234 // static | 
|  236 int64_t Shell::GetTargetDisplayId() { |  235 int64_t Shell::GetTargetDisplayId() { | 
|  237   return display::Screen::GetScreen() |  236   return display::Screen::GetScreen() | 
|  238       ->GetDisplayNearestWindow(GetTargetRootWindow()) |  237       ->GetDisplayNearestWindow(GetTargetRootWindow()) | 
|  239       .id(); |  238       .id(); | 
|  240 } |  239 } | 
|  241  |  240  | 
|  242 // static |  241 // static | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  281 } |  280 } | 
|  282  |  281  | 
|  283 void Shell::OnLockStateChanged(bool locked) { |  282 void Shell::OnLockStateChanged(bool locked) { | 
|  284   for (auto& observer : *wm_shell_->shell_observers()) |  283   for (auto& observer : *wm_shell_->shell_observers()) | 
|  285     observer.OnLockStateChanged(locked); |  284     observer.OnLockStateChanged(locked); | 
|  286 #ifndef NDEBUG |  285 #ifndef NDEBUG | 
|  287   // Make sure that there is no system modal in Lock layer when unlocked. |  286   // Make sure that there is no system modal in Lock layer when unlocked. | 
|  288   if (!locked) { |  287   if (!locked) { | 
|  289     std::vector<WmWindow*> containers = wm::GetContainersFromAllRootWindows( |  288     std::vector<WmWindow*> containers = wm::GetContainersFromAllRootWindows( | 
|  290         kShellWindowId_LockSystemModalContainer, |  289         kShellWindowId_LockSystemModalContainer, | 
|  291         WmWindowAura::Get(GetPrimaryRootWindow())); |  290         WmWindow::Get(GetPrimaryRootWindow())); | 
|  292     for (WmWindow* container : containers) |  291     for (WmWindow* container : containers) | 
|  293       DCHECK(container->GetChildren().empty()); |  292       DCHECK(container->GetChildren().empty()); | 
|  294   } |  293   } | 
|  295 #endif |  294 #endif | 
|  296 } |  295 } | 
|  297  |  296  | 
|  298 void Shell::OnCastingSessionStartedOrStopped(bool started) { |  297 void Shell::OnCastingSessionStartedOrStopped(bool started) { | 
|  299   for (auto& observer : *wm_shell_->shell_observers()) |  298   for (auto& observer : *wm_shell_->shell_observers()) | 
|  300     observer.OnCastingSessionStartedOrStopped(started); |  299     observer.OnCastingSessionStartedOrStopped(started); | 
|  301 } |  300 } | 
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  630       new ::wm::FocusController(focus_rules); |  629       new ::wm::FocusController(focus_rules); | 
|  631   focus_client_.reset(focus_controller); |  630   focus_client_.reset(focus_controller); | 
|  632   activation_client_ = focus_controller; |  631   activation_client_ = focus_controller; | 
|  633  |  632  | 
|  634   screen_position_controller_.reset(new ScreenPositionController); |  633   screen_position_controller_.reset(new ScreenPositionController); | 
|  635  |  634  | 
|  636   window_tree_host_manager_->Start(); |  635   window_tree_host_manager_->Start(); | 
|  637   AshWindowTreeHostInitParams ash_init_params; |  636   AshWindowTreeHostInitParams ash_init_params; | 
|  638   window_tree_host_manager_->CreatePrimaryHost(ash_init_params); |  637   window_tree_host_manager_->CreatePrimaryHost(ash_init_params); | 
|  639   aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow(); |  638   aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow(); | 
|  640   wm_shell_->set_root_window_for_new_windows(WmWindowAura::Get(root_window)); |  639   wm_shell_->set_root_window_for_new_windows(WmWindow::Get(root_window)); | 
|  641  |  640  | 
|  642   resolution_notification_controller_.reset( |  641   resolution_notification_controller_.reset( | 
|  643       new ResolutionNotificationController); |  642       new ResolutionNotificationController); | 
|  644  |  643  | 
|  645   if (cursor_manager_) |  644   if (cursor_manager_) | 
|  646     cursor_manager_->SetDisplay( |  645     cursor_manager_->SetDisplay( | 
|  647         display::Screen::GetScreen()->GetPrimaryDisplay()); |  646         display::Screen::GetScreen()->GetPrimaryDisplay()); | 
|  648  |  647  | 
|  649   accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateAura); |  648   accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateAura); | 
|  650   wm_shell_->SetAcceleratorController(base::MakeUnique<AcceleratorController>( |  649   wm_shell_->SetAcceleratorController(base::MakeUnique<AcceleratorController>( | 
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  852 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |  851 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 
|  853   return std::unique_ptr<ui::EventTargetIterator>(); |  852   return std::unique_ptr<ui::EventTargetIterator>(); | 
|  854 } |  853 } | 
|  855  |  854  | 
|  856 ui::EventTargeter* Shell::GetEventTargeter() { |  855 ui::EventTargeter* Shell::GetEventTargeter() { | 
|  857   NOTREACHED(); |  856   NOTREACHED(); | 
|  858   return nullptr; |  857   return nullptr; | 
|  859 } |  858 } | 
|  860  |  859  | 
|  861 }  // namespace ash |  860 }  // namespace ash | 
| OLD | NEW |