Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: ash/root_window_controller.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "ash/ash_touch_exploration_manager_chromeos.h" 11 #include "ash/ash_touch_exploration_manager_chromeos.h"
12 #include "ash/aura/aura_layout_manager_adapter.h" 12 #include "ash/aura/aura_layout_manager_adapter.h"
13 #include "ash/common/ash_constants.h" 13 #include "ash/common/ash_constants.h"
14 #include "ash/common/ash_switches.h" 14 #include "ash/common/ash_switches.h"
15 #include "ash/common/focus_cycler.h" 15 #include "ash/common/focus_cycler.h"
16 #include "ash/common/login_status.h" 16 #include "ash/common/login_status.h"
17 #include "ash/common/session/session_state_delegate.h" 17 #include "ash/common/session/session_controller.h"
18 #include "ash/common/shelf/shelf_delegate.h" 18 #include "ash/common/shelf/shelf_delegate.h"
19 #include "ash/common/shelf/shelf_layout_manager.h" 19 #include "ash/common/shelf/shelf_layout_manager.h"
20 #include "ash/common/shelf/shelf_widget.h" 20 #include "ash/common/shelf/shelf_widget.h"
21 #include "ash/common/shelf/wm_shelf.h" 21 #include "ash/common/shelf/wm_shelf.h"
22 #include "ash/common/shell_delegate.h" 22 #include "ash/common/shell_delegate.h"
23 #include "ash/common/system/status_area_layout_manager.h" 23 #include "ash/common/system/status_area_layout_manager.h"
24 #include "ash/common/system/status_area_widget.h" 24 #include "ash/common/system/status_area_widget.h"
25 #include "ash/common/system/tray/system_tray_delegate.h" 25 #include "ash/common/system/tray/system_tray_delegate.h"
26 #include "ash/common/wallpaper/wallpaper_delegate.h" 26 #include "ash/common/wallpaper/wallpaper_delegate.h"
27 #include "ash/common/wallpaper/wallpaper_widget_controller.h" 27 #include "ash/common/wallpaper/wallpaper_widget_controller.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 WmWindow* window_container = wm::GetContainerForWindow(window); 402 WmWindow* window_container = wm::GetContainerForWindow(window);
403 if (window_container && 403 if (window_container &&
404 window_container->GetShellWindowId() >= 404 window_container->GetShellWindowId() >=
405 kShellWindowId_LockScreenContainer) { 405 kShellWindowId_LockScreenContainer) {
406 modal_container = GetWmContainer(kShellWindowId_LockSystemModalContainer); 406 modal_container = GetWmContainer(kShellWindowId_LockSystemModalContainer);
407 } else { 407 } else {
408 modal_container = GetWmContainer(kShellWindowId_SystemModalContainer); 408 modal_container = GetWmContainer(kShellWindowId_SystemModalContainer);
409 } 409 }
410 } else { 410 } else {
411 int modal_window_id = 411 int modal_window_id =
412 WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked() 412 WmShell::Get()->session_controller()->IsUserSessionBlocked()
413 ? kShellWindowId_LockSystemModalContainer 413 ? kShellWindowId_LockSystemModalContainer
414 : kShellWindowId_SystemModalContainer; 414 : kShellWindowId_SystemModalContainer;
415 modal_container = GetWmContainer(modal_window_id); 415 modal_container = GetWmContainer(modal_window_id);
416 } 416 }
417 return modal_container ? static_cast<SystemModalContainerLayoutManager*>( 417 return modal_container ? static_cast<SystemModalContainerLayoutManager*>(
418 modal_container->GetLayoutManager()) 418 modal_container->GetLayoutManager())
419 : nullptr; 419 : nullptr;
420 } 420 }
421 421
422 StatusAreaWidget* RootWindowController::GetStatusAreaWidget() { 422 StatusAreaWidget* RootWindowController::GetStatusAreaWidget() {
(...skipping 13 matching lines...) Expand all
436 return false; 436 return false;
437 437
438 // Always allow events to fall through to the virtual keyboard even if 438 // Always allow events to fall through to the virtual keyboard even if
439 // displaying a system modal dialog. 439 // displaying a system modal dialog.
440 if (IsVirtualKeyboardWindow(window)) 440 if (IsVirtualKeyboardWindow(window))
441 return true; 441 return true;
442 442
443 aura::Window* blocking_container = nullptr; 443 aura::Window* blocking_container = nullptr;
444 444
445 int modal_container_id = 0; 445 int modal_container_id = 0;
446 if (WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()) { 446 if (WmShell::Get()->session_controller()->IsUserSessionBlocked()) {
447 blocking_container = 447 blocking_container =
448 GetContainer(kShellWindowId_LockScreenContainersContainer); 448 GetContainer(kShellWindowId_LockScreenContainersContainer);
449 modal_container_id = kShellWindowId_LockSystemModalContainer; 449 modal_container_id = kShellWindowId_LockSystemModalContainer;
450 } else { 450 } else {
451 modal_container_id = kShellWindowId_SystemModalContainer; 451 modal_container_id = kShellWindowId_SystemModalContainer;
452 } 452 }
453 aura::Window* modal_container = GetContainer(modal_container_id); 453 aura::Window* modal_container = GetContainer(modal_container_id);
454 SystemModalContainerLayoutManager* modal_layout_manager = nullptr; 454 SystemModalContainerLayoutManager* modal_layout_manager = nullptr;
455 modal_layout_manager = static_cast<SystemModalContainerLayoutManager*>( 455 modal_layout_manager = static_cast<SystemModalContainerLayoutManager*>(
456 WmWindow::Get(modal_container)->GetLayoutManager()); 456 WmWindow::Get(modal_container)->GetLayoutManager());
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 shell->AddShellObserver(this); 795 shell->AddShellObserver(this);
796 796
797 root_window_layout_manager_->OnWindowResized(); 797 root_window_layout_manager_->OnWindowResized();
798 if (root_window_type == RootWindowType::PRIMARY) { 798 if (root_window_type == RootWindowType::PRIMARY) {
799 if (!wm_shell->IsRunningInMash()) 799 if (!wm_shell->IsRunningInMash())
800 shell->InitKeyboard(); 800 shell->InitKeyboard();
801 } else { 801 } else {
802 window_tree_host_->Show(); 802 window_tree_host_->Show();
803 803
804 // Create a shelf if a user is already logged in. 804 // Create a shelf if a user is already logged in.
805 if (wm_shell->GetSessionStateDelegate()->NumberOfLoggedInUsers()) 805 if (wm_shell->session_controller()->NumberOfLoggedInUsers())
806 CreateShelfView(); 806 CreateShelfView();
807 807
808 // Notify shell observers about new root window. 808 // Notify shell observers about new root window.
809 shell->OnRootWindowAdded(WmWindow::Get(root_window)); 809 shell->OnRootWindowAdded(WmWindow::Get(root_window));
810 } 810 }
811 811
812 // TODO: AshTouchExplorationManager doesn't work with mus. 812 // TODO: AshTouchExplorationManager doesn't work with mus.
813 // http://crbug.com/679782 813 // http://crbug.com/679782
814 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 814 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
815 switches::kAshDisableTouchExplorationMode) && 815 switches::kAshDisableTouchExplorationMode) &&
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 EnableTouchHudProjection(); 1142 EnableTouchHudProjection();
1143 else 1143 else
1144 DisableTouchHudProjection(); 1144 DisableTouchHudProjection();
1145 } 1145 }
1146 1146
1147 RootWindowController* GetRootWindowController(const aura::Window* root_window) { 1147 RootWindowController* GetRootWindowController(const aura::Window* root_window) {
1148 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; 1148 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr;
1149 } 1149 }
1150 1150
1151 } // namespace ash 1151 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698