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

Side by Side Diff: ash/root_window_controller.cc

Issue 2111443002: mash: Migrate SessionStateDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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 <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/aura/aura_layout_manager_adapter.h" 10 #include "ash/aura/aura_layout_manager_adapter.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } 291 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; }
292 292
293 // WorkspaceLayoutManagerDelegate: 293 // WorkspaceLayoutManagerDelegate:
294 void UpdateShelfVisibility() override { 294 void UpdateShelfVisibility() override {
295 if (shelf_) 295 if (shelf_)
296 shelf_->UpdateVisibilityState(); 296 shelf_->UpdateVisibilityState();
297 } 297 }
298 void OnFullscreenStateChanged(bool is_fullscreen) override { 298 void OnFullscreenStateChanged(bool is_fullscreen) override {
299 if (shelf_) { 299 if (shelf_) {
300 ash::Shell::GetInstance()->NotifyFullscreenStateChange( 300 Shell::GetInstance()->NotifyFullscreenStateChange(
301 is_fullscreen, WmWindowAura::Get(root_window_)); 301 is_fullscreen, WmWindowAura::Get(root_window_));
302 } 302 }
303 } 303 }
304 304
305 private: 305 private:
306 aura::Window* root_window_; 306 aura::Window* root_window_;
307 ShelfLayoutManager* shelf_ = nullptr; 307 ShelfLayoutManager* shelf_ = nullptr;
308 308
309 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerDelegateImpl); 309 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerDelegateImpl);
310 }; 310 };
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 return false; 414 return false;
415 415
416 // Always allow events to fall through to the virtual keyboard even if 416 // Always allow events to fall through to the virtual keyboard even if
417 // displaying a system modal dialog. 417 // displaying a system modal dialog.
418 if (IsVirtualKeyboardWindow(window)) 418 if (IsVirtualKeyboardWindow(window))
419 return true; 419 return true;
420 420
421 aura::Window* blocking_container = nullptr; 421 aura::Window* blocking_container = nullptr;
422 422
423 int modal_container_id = 0; 423 int modal_container_id = 0;
424 if (Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked()) { 424 if (WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()) {
425 blocking_container = 425 blocking_container =
426 GetContainer(kShellWindowId_LockScreenContainersContainer); 426 GetContainer(kShellWindowId_LockScreenContainersContainer);
427 modal_container_id = kShellWindowId_LockSystemModalContainer; 427 modal_container_id = kShellWindowId_LockSystemModalContainer;
428 } else { 428 } else {
429 modal_container_id = kShellWindowId_SystemModalContainer; 429 modal_container_id = kShellWindowId_SystemModalContainer;
430 } 430 }
431 aura::Window* modal_container = GetContainer(modal_container_id); 431 aura::Window* modal_container = GetContainer(modal_container_id);
432 SystemModalContainerLayoutManager* modal_layout_manager = nullptr; 432 SystemModalContainerLayoutManager* modal_layout_manager = nullptr;
433 modal_layout_manager = static_cast<SystemModalContainerLayoutManager*>( 433 modal_layout_manager = static_cast<SystemModalContainerLayoutManager*>(
434 modal_container->layout_manager()); 434 modal_container->layout_manager());
(...skipping 25 matching lines...) Expand all
460 aura::Window* window_container = WmWindowAura::GetAuraWindow( 460 aura::Window* window_container = WmWindowAura::GetAuraWindow(
461 wm::GetContainerForWindow(WmWindowAura::Get(window))); 461 wm::GetContainerForWindow(WmWindowAura::Get(window)));
462 if (window_container && 462 if (window_container &&
463 window_container->id() >= kShellWindowId_LockScreenContainer) { 463 window_container->id() >= kShellWindowId_LockScreenContainer) {
464 modal_container = GetContainer(kShellWindowId_LockSystemModalContainer); 464 modal_container = GetContainer(kShellWindowId_LockSystemModalContainer);
465 } else { 465 } else {
466 modal_container = GetContainer(kShellWindowId_SystemModalContainer); 466 modal_container = GetContainer(kShellWindowId_SystemModalContainer);
467 } 467 }
468 } else { 468 } else {
469 int modal_window_id = 469 int modal_window_id =
470 Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked() 470 WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()
471 ? kShellWindowId_LockSystemModalContainer 471 ? kShellWindowId_LockSystemModalContainer
472 : kShellWindowId_SystemModalContainer; 472 : kShellWindowId_SystemModalContainer;
473 modal_container = GetContainer(modal_window_id); 473 modal_container = GetContainer(modal_window_id);
474 } 474 }
475 return modal_container ? static_cast<SystemModalContainerLayoutManager*>( 475 return modal_container ? static_cast<SystemModalContainerLayoutManager*>(
476 modal_container->layout_manager()) 476 modal_container->layout_manager())
477 : NULL; 477 : NULL;
478 } 478 }
479 479
480 aura::Window* RootWindowController::GetContainer(int container_id) { 480 aura::Window* RootWindowController::GetContainer(int container_id) {
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 791
792 WmShell::Get()->AddShellObserver(this); 792 WmShell::Get()->AddShellObserver(this);
793 793
794 root_window_controller_common_->root_window_layout()->OnWindowResized(); 794 root_window_controller_common_->root_window_layout()->OnWindowResized();
795 if (root_window_type == PRIMARY) { 795 if (root_window_type == PRIMARY) {
796 shell->InitKeyboard(); 796 shell->InitKeyboard();
797 } else { 797 } else {
798 ash_host_->AsWindowTreeHost()->Show(); 798 ash_host_->AsWindowTreeHost()->Show();
799 799
800 // Create a shelf if a user is already logged in. 800 // Create a shelf if a user is already logged in.
801 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) 801 if (WmShell::Get()->GetSessionStateDelegate()->NumberOfLoggedInUsers())
802 CreateShelf(); 802 CreateShelf();
803 803
804 // Notify shell observers about new root window. 804 // Notify shell observers about new root window.
805 shell->OnRootWindowAdded(WmWindowAura::Get(root_window)); 805 shell->OnRootWindowAdded(WmWindowAura::Get(root_window));
806 } 806 }
807 807
808 #if defined(OS_CHROMEOS) 808 #if defined(OS_CHROMEOS)
809 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 809 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
810 switches::kAshDisableTouchExplorationMode)) { 810 switches::kAshDisableTouchExplorationMode)) {
811 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); 811 touch_exploration_manager_.reset(new AshTouchExplorationManager(this));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 WmWindow* shelf_container = 853 WmWindow* shelf_container =
854 WmWindowAura::Get(GetContainer(kShellWindowId_ShelfContainer)); 854 WmWindowAura::Get(GetContainer(kShellWindowId_ShelfContainer));
855 WmWindow* status_container = 855 WmWindow* status_container =
856 WmWindowAura::Get(GetContainer(kShellWindowId_StatusContainer)); 856 WmWindowAura::Get(GetContainer(kShellWindowId_StatusContainer));
857 shelf_widget_.reset(new ShelfWidget(shelf_container, status_container, 857 shelf_widget_.reset(new ShelfWidget(shelf_container, status_container,
858 wm_shelf_aura_.get(), 858 wm_shelf_aura_.get(),
859 workspace_controller())); 859 workspace_controller()));
860 workspace_layout_manager_delegate->set_shelf( 860 workspace_layout_manager_delegate->set_shelf(
861 shelf_widget_->shelf_layout_manager()); 861 shelf_widget_->shelf_layout_manager());
862 862
863 if (!Shell::GetInstance() 863 if (!WmShell::Get()
864 ->session_state_delegate() 864 ->GetSessionStateDelegate()
865 ->IsActiveUserSessionStarted()) { 865 ->IsActiveUserSessionStarted()) {
866 // This window exists only to be a event target on login screen. 866 // This window exists only to be a event target on login screen.
867 // It does not have to handle events, nor be visible. 867 // It does not have to handle events, nor be visible.
868 mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate)); 868 mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate));
869 mouse_event_target_->Init(ui::LAYER_NOT_DRAWN); 869 mouse_event_target_->Init(ui::LAYER_NOT_DRAWN);
870 870
871 aura::Window* lock_background_container = 871 aura::Window* lock_background_container =
872 GetContainer(kShellWindowId_LockScreenBackgroundContainer); 872 GetContainer(kShellWindowId_LockScreenBackgroundContainer);
873 lock_background_container->AddChild(mouse_event_target_.get()); 873 lock_background_container->AddChild(mouse_event_target_.get());
874 mouse_event_target_->Show(); 874 mouse_event_target_->Show();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 aura::Window* primary_root_window = Shell::GetInstance() 977 aura::Window* primary_root_window = Shell::GetInstance()
978 ->window_tree_host_manager() 978 ->window_tree_host_manager()
979 ->GetPrimaryRootWindow(); 979 ->GetPrimaryRootWindow();
980 return GetRootWindowSettings(primary_root_window)->controller; 980 return GetRootWindowSettings(primary_root_window)->controller;
981 } 981 }
982 982
983 return GetRootWindowSettings(root_window)->controller; 983 return GetRootWindowSettings(root_window)->controller;
984 } 984 }
985 985
986 } // namespace ash 986 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698