| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_port.h" | 5 #include "ash/shell_port.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void ShellPort::Shutdown() {} | 40 void ShellPort::Shutdown() {} |
| 41 | 41 |
| 42 void ShellPort::ShowContextMenu(const gfx::Point& location_in_screen, | 42 void ShellPort::ShowContextMenu(const gfx::Point& location_in_screen, |
| 43 ui::MenuSourceType source_type) { | 43 ui::MenuSourceType source_type) { |
| 44 // Bail if there is no active user session or if the screen is locked. | 44 // Bail if there is no active user session or if the screen is locked. |
| 45 if (Shell::Get()->session_controller()->NumberOfLoggedInUsers() < 1 || | 45 if (Shell::Get()->session_controller()->NumberOfLoggedInUsers() < 1 || |
| 46 Shell::Get()->session_controller()->IsScreenLocked()) { | 46 Shell::Get()->session_controller()->IsScreenLocked()) { |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 | 49 |
| 50 WmWindow* root = wm::GetRootWindowAt(location_in_screen); | 50 aura::Window* root = wm::GetRootWindowAt(location_in_screen); |
| 51 root->GetRootWindowController()->ShowContextMenu(location_in_screen, | 51 RootWindowController::ForWindow(root)->ShowContextMenu(location_in_screen, |
| 52 source_type); | 52 source_type); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void ShellPort::OnLockStateEvent(LockStateObserver::EventType event) { | 55 void ShellPort::OnLockStateEvent(LockStateObserver::EventType event) { |
| 56 for (auto& observer : lock_state_observers_) | 56 for (auto& observer : lock_state_observers_) |
| 57 observer.OnLockStateEvent(event); | 57 observer.OnLockStateEvent(event); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ShellPort::AddLockStateObserver(LockStateObserver* observer) { | 60 void ShellPort::AddLockStateObserver(LockStateObserver* observer) { |
| 61 lock_state_observers_.AddObserver(observer); | 61 lock_state_observers_.AddObserver(observer); |
| 62 } | 62 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 for (aura::Window* root_window : root_windows) { | 114 for (aura::Window* root_window : root_windows) { |
| 115 RootWindowController::ForWindow(root_window) | 115 RootWindowController::ForWindow(root_window) |
| 116 ->GetSystemModalLayoutManager(removed) | 116 ->GetSystemModalLayoutManager(removed) |
| 117 ->DestroyModalBackground(); | 117 ->DestroyModalBackground(); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace ash | 121 } // namespace ash |
| OLD | NEW |