| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/overview/window_selector_controller.h" | 5 #include "ash/common/wm/overview/window_selector_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" | 10 #include "ash/common/system/tray/system_tray_delegate.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 bool WindowSelectorController::CanSelect() { | 32 bool WindowSelectorController::CanSelect() { |
| 33 // Don't allow a window overview if the screen is locked or a modal dialog is | 33 // Don't allow a window overview if the screen is locked or a modal dialog is |
| 34 // open or running in kiosk app session. | 34 // open or running in kiosk app session. |
| 35 SessionStateDelegate* session_state_delegate = | 35 SessionStateDelegate* session_state_delegate = |
| 36 WmShell::Get()->GetSessionStateDelegate(); | 36 WmShell::Get()->GetSessionStateDelegate(); |
| 37 return session_state_delegate->IsActiveUserSessionStarted() && | 37 return session_state_delegate->IsActiveUserSessionStarted() && |
| 38 !session_state_delegate->IsScreenLocked() && | 38 !session_state_delegate->IsScreenLocked() && |
| 39 !WmShell::Get()->IsSystemModalWindowOpen() && | 39 !WmShell::Get()->IsSystemModalWindowOpen() && |
| 40 !WmShell::Get()->IsPinned() && | 40 !WmShell::Get()->IsPinned() && |
| 41 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 41 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| 42 LoginStatus::KIOSK_APP; | 42 LoginStatus::KIOSK_APP && |
| 43 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| 44 LoginStatus::ARC_KIOSK_APP; |
| 43 } | 45 } |
| 44 | 46 |
| 45 void WindowSelectorController::ToggleOverview() { | 47 void WindowSelectorController::ToggleOverview() { |
| 46 if (IsSelecting()) { | 48 if (IsSelecting()) { |
| 47 OnSelectionEnded(); | 49 OnSelectionEnded(); |
| 48 } else { | 50 } else { |
| 49 // Don't start overview if window selection is not allowed. | 51 // Don't start overview if window selection is not allowed. |
| 50 if (!CanSelect()) | 52 if (!CanSelect()) |
| 51 return; | 53 return; |
| 52 | 54 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 114 } |
| 113 | 115 |
| 114 void WindowSelectorController::OnSelectionStarted() { | 116 void WindowSelectorController::OnSelectionStarted() { |
| 115 if (!last_selection_time_.is_null()) { | 117 if (!last_selection_time_.is_null()) { |
| 116 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", | 118 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", |
| 117 base::Time::Now() - last_selection_time_); | 119 base::Time::Now() - last_selection_time_); |
| 118 } | 120 } |
| 119 } | 121 } |
| 120 | 122 |
| 121 } // namespace ash | 123 } // namespace ash |
| OLD | NEW |