| Index: ash/wm_shell.cc
|
| diff --git a/ash/wm_shell.cc b/ash/wm_shell.cc
|
| deleted file mode 100644
|
| index 1d553010da49ebba7495d20548b86921a0bbffd2..0000000000000000000000000000000000000000
|
| --- a/ash/wm_shell.cc
|
| +++ /dev/null
|
| @@ -1,126 +0,0 @@
|
| -// Copyright 2016 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "ash/wm_shell.h"
|
| -
|
| -#include <utility>
|
| -
|
| -#include "ash/accelerators/accelerator_controller.h"
|
| -#include "ash/public/cpp/shell_window_ids.h"
|
| -#include "ash/root_window_controller.h"
|
| -#include "ash/session/session_controller.h"
|
| -#include "ash/session/session_state_delegate.h"
|
| -#include "ash/shelf/app_list_shelf_item_delegate.h"
|
| -#include "ash/shell.h"
|
| -#include "ash/shell_delegate.h"
|
| -#include "ash/wm/root_window_finder.h"
|
| -#include "ash/wm/system_modal_container_layout_manager.h"
|
| -#include "ash/wm_window.h"
|
| -#include "base/bind.h"
|
| -#include "base/logging.h"
|
| -#include "base/memory/ptr_util.h"
|
| -#include "ui/display/display.h"
|
| -
|
| -namespace ash {
|
| -
|
| -// static
|
| -WmShell* WmShell::instance_ = nullptr;
|
| -
|
| -WmShell::~WmShell() {
|
| - DCHECK_EQ(this, instance_);
|
| - instance_ = nullptr;
|
| -}
|
| -
|
| -// static
|
| -WmShell* WmShell::Get() {
|
| - return instance_;
|
| -}
|
| -
|
| -void WmShell::Shutdown() {
|
| -}
|
| -
|
| -void WmShell::ShowContextMenu(const gfx::Point& location_in_screen,
|
| - ui::MenuSourceType source_type) {
|
| - // Bail if there is no active user session or if the screen is locked.
|
| - if (Shell::Get()->session_controller()->NumberOfLoggedInUsers() < 1 ||
|
| - Shell::Get()->session_controller()->IsScreenLocked()) {
|
| - return;
|
| - }
|
| -
|
| - WmWindow* root = wm::GetRootWindowAt(location_in_screen);
|
| - root->GetRootWindowController()->ShowContextMenu(location_in_screen,
|
| - source_type);
|
| -}
|
| -
|
| -void WmShell::OnLockStateEvent(LockStateObserver::EventType event) {
|
| - for (auto& observer : lock_state_observers_)
|
| - observer.OnLockStateEvent(event);
|
| -}
|
| -
|
| -void WmShell::AddLockStateObserver(LockStateObserver* observer) {
|
| - lock_state_observers_.AddObserver(observer);
|
| -}
|
| -
|
| -void WmShell::RemoveLockStateObserver(LockStateObserver* observer) {
|
| - lock_state_observers_.RemoveObserver(observer);
|
| -}
|
| -
|
| -WmShell::WmShell() {
|
| - DCHECK(!instance_);
|
| - instance_ = this;
|
| -}
|
| -
|
| -RootWindowController* WmShell::GetPrimaryRootWindowController() {
|
| - return GetPrimaryRootWindow()->GetRootWindowController();
|
| -}
|
| -
|
| -bool WmShell::IsForceMaximizeOnFirstRun() {
|
| - return Shell::Get()->shell_delegate()->IsForceMaximizeOnFirstRun();
|
| -}
|
| -
|
| -bool WmShell::IsSystemModalWindowOpen() {
|
| - if (simulate_modal_window_open_for_testing_)
|
| - return true;
|
| -
|
| - // Traverse all system modal containers, and find its direct child window
|
| - // with "SystemModal" setting, and visible.
|
| - for (WmWindow* root : GetAllRootWindows()) {
|
| - WmWindow* system_modal =
|
| - root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer);
|
| - if (!system_modal)
|
| - continue;
|
| - for (const WmWindow* child : system_modal->GetChildren()) {
|
| - if (child->IsSystemModal() && child->GetTargetVisibility()) {
|
| - return true;
|
| - }
|
| - }
|
| - }
|
| - return false;
|
| -}
|
| -
|
| -void WmShell::CreateModalBackground(WmWindow* window) {
|
| - for (WmWindow* root_window : GetAllRootWindows()) {
|
| - root_window->GetRootWindowController()
|
| - ->GetSystemModalLayoutManager(window)
|
| - ->CreateModalBackground();
|
| - }
|
| -}
|
| -
|
| -void WmShell::OnModalWindowRemoved(WmWindow* removed) {
|
| - WmWindow::Windows root_windows = GetAllRootWindows();
|
| - for (WmWindow* root_window : root_windows) {
|
| - if (root_window->GetRootWindowController()
|
| - ->GetSystemModalLayoutManager(removed)
|
| - ->ActivateNextModalWindow()) {
|
| - return;
|
| - }
|
| - }
|
| - for (WmWindow* root_window : root_windows) {
|
| - root_window->GetRootWindowController()
|
| - ->GetSystemModalLayoutManager(removed)
|
| - ->DestroyModalBackground();
|
| - }
|
| -}
|
| -
|
| -} // namespace ash
|
|
|