| 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_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/system/tray/system_tray_delegate.h" |
| 8 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/common/wm/wm_event.h" | 10 #include "ash/common/wm/wm_event.h" |
| 10 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 11 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 12 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 namespace wm { | 16 namespace wm { |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 46 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen()) | 47 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen()) |
| 47 return false; | 48 return false; |
| 48 | 49 |
| 49 // Test that the touch happened in the top or bottom lines. | 50 // Test that the touch happened in the top or bottom lines. |
| 50 int y = event.y(); | 51 int y = event.y(); |
| 51 if (y >= kLeaveFullScreenAreaHeightInPixel && | 52 if (y >= kLeaveFullScreenAreaHeightInPixel && |
| 52 y < (window->GetBounds().height() - kLeaveFullScreenAreaHeightInPixel)) { | 53 y < (window->GetBounds().height() - kLeaveFullScreenAreaHeightInPixel)) { |
| 53 return false; | 54 return false; |
| 54 } | 55 } |
| 55 | 56 |
| 57 // Do not exit fullscreen in kiosk mode. |
| 58 SystemTrayDelegate* system_tray_delegate = |
| 59 WmShell::Get()->system_tray_delegate(); |
| 60 if (system_tray_delegate->GetUserLoginStatus() == LoginStatus::KIOSK_APP || |
| 61 system_tray_delegate->GetUserLoginStatus() == |
| 62 LoginStatus::ARC_KIOSK_APP) { |
| 63 return false; |
| 64 } |
| 65 |
| 56 WMEvent toggle_fullscreen(WM_EVENT_TOGGLE_FULLSCREEN); | 66 WMEvent toggle_fullscreen(WM_EVENT_TOGGLE_FULLSCREEN); |
| 57 window->GetWindowState()->OnWMEvent(&toggle_fullscreen); | 67 window->GetWindowState()->OnWMEvent(&toggle_fullscreen); |
| 58 return true; | 68 return true; |
| 59 } | 69 } |
| 60 | 70 |
| 61 } // namespace wm | 71 } // namespace wm |
| 62 } // namespace ash | 72 } // namespace ash |
| OLD | NEW |