| 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/common/wm/maximize_mode/maximize_mode_event_handler.h" | 5 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/common/session/session_controller.h" | 7 #include "ash/common/session/session_controller.h" |
| 8 #include "ash/common/system/tray/system_tray_delegate.h" | 8 #include "ash/common/system/tray/system_tray_delegate.h" |
| 9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
| 10 #include "ash/common/wm/wm_event.h" | 10 #include "ash/common/wm/wm_event.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 MaximizeModeEventHandler::MaximizeModeEventHandler() {} | 26 MaximizeModeEventHandler::MaximizeModeEventHandler() {} |
| 27 | 27 |
| 28 MaximizeModeEventHandler::~MaximizeModeEventHandler() {} | 28 MaximizeModeEventHandler::~MaximizeModeEventHandler() {} |
| 29 | 29 |
| 30 bool MaximizeModeEventHandler::ToggleFullscreen(const ui::TouchEvent& event) { | 30 bool MaximizeModeEventHandler::ToggleFullscreen(const ui::TouchEvent& event) { |
| 31 if (event.type() != ui::ET_TOUCH_PRESSED) | 31 if (event.type() != ui::ET_TOUCH_PRESSED) |
| 32 return false; | 32 return false; |
| 33 | 33 |
| 34 const SessionController* controller = WmShell::Get()->session_controller(); | 34 const SessionController* controller = Shell::Get()->session_controller(); |
| 35 | 35 |
| 36 if (controller->IsScreenLocked() || | 36 if (controller->IsScreenLocked() || |
| 37 controller->GetSessionState() != session_manager::SessionState::ACTIVE) { | 37 controller->GetSessionState() != session_manager::SessionState::ACTIVE) { |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Find the active window (from the primary screen) to un-fullscreen. | 41 // Find the active window (from the primary screen) to un-fullscreen. |
| 42 WmWindow* window = WmShell::Get()->GetActiveWindow(); | 42 WmWindow* window = WmShell::Get()->GetActiveWindow(); |
| 43 if (!window) | 43 if (!window) |
| 44 return false; | 44 return false; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 | 65 |
| 66 WMEvent toggle_fullscreen(WM_EVENT_TOGGLE_FULLSCREEN); | 66 WMEvent toggle_fullscreen(WM_EVENT_TOGGLE_FULLSCREEN); |
| 67 window->GetWindowState()->OnWMEvent(&toggle_fullscreen); | 67 window->GetWindowState()->OnWMEvent(&toggle_fullscreen); |
| 68 return true; | 68 return true; |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace wm | 71 } // namespace wm |
| 72 } // namespace ash | 72 } // namespace ash |
| OLD | NEW |