| 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/wm/overview/window_selector_controller.h" | 5 #include "ash/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 15 matching lines...) Expand all  Loading... | 
| 26 | 26 | 
| 27 // static | 27 // static | 
| 28 bool WindowSelectorController::CanSelect() { | 28 bool WindowSelectorController::CanSelect() { | 
| 29   // Don't allow a window overview if the screen is locked or a modal dialog is | 29   // Don't allow a window overview if the screen is locked or a modal dialog is | 
| 30   // open or running in kiosk app session. | 30   // open or running in kiosk app session. | 
| 31   SessionStateDelegate* session_state_delegate = | 31   SessionStateDelegate* session_state_delegate = | 
| 32       WmShell::Get()->GetSessionStateDelegate(); | 32       WmShell::Get()->GetSessionStateDelegate(); | 
| 33   return session_state_delegate->IsActiveUserSessionStarted() && | 33   return session_state_delegate->IsActiveUserSessionStarted() && | 
| 34          !session_state_delegate->IsScreenLocked() && | 34          !session_state_delegate->IsScreenLocked() && | 
| 35          !Shell::GetInstance()->IsSystemModalWindowOpen() && | 35          !Shell::GetInstance()->IsSystemModalWindowOpen() && | 
|  | 36          !WmShell::Get()->IsPinned() && | 
| 36          WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 37          WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 
| 37              LoginStatus::KIOSK_APP; | 38              LoginStatus::KIOSK_APP; | 
| 38 } | 39 } | 
| 39 | 40 | 
| 40 void WindowSelectorController::ToggleOverview() { | 41 void WindowSelectorController::ToggleOverview() { | 
| 41   if (IsSelecting()) { | 42   if (IsSelecting()) { | 
| 42     OnSelectionEnded(); | 43     OnSelectionEnded(); | 
| 43   } else { | 44   } else { | 
| 44     // Don't start overview if window selection is not allowed. | 45     // Don't start overview if window selection is not allowed. | 
| 45     if (!CanSelect()) | 46     if (!CanSelect()) | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 83 | 84 | 
| 84 void WindowSelectorController::OnSelectionStarted() { | 85 void WindowSelectorController::OnSelectionStarted() { | 
| 85   if (!last_selection_time_.is_null()) { | 86   if (!last_selection_time_.is_null()) { | 
| 86     UMA_HISTOGRAM_LONG_TIMES( | 87     UMA_HISTOGRAM_LONG_TIMES( | 
| 87         "Ash.WindowSelector.TimeBetweenUse", | 88         "Ash.WindowSelector.TimeBetweenUse", | 
| 88         base::Time::Now() - last_selection_time_); | 89         base::Time::Now() - last_selection_time_); | 
| 89   } | 90   } | 
| 90 } | 91 } | 
| 91 | 92 | 
| 92 }  // namespace ash | 93 }  // namespace ash | 
| OLD | NEW | 
|---|