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_controller.h" | 9 #include "ash/common/session/session_controller.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 for (std::unique_ptr<DelayedAnimationObserver>& animation_observer : | 26 for (std::unique_ptr<DelayedAnimationObserver>& animation_observer : |
27 delayed_animations_) { | 27 delayed_animations_) { |
28 animation_observer->Shutdown(); | 28 animation_observer->Shutdown(); |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 // static | 32 // static |
33 bool WindowSelectorController::CanSelect() { | 33 bool WindowSelectorController::CanSelect() { |
34 // Don't allow a window overview if the screen is locked or a modal dialog is | 34 // Don't allow a window overview if the screen is locked or a modal dialog is |
35 // open or running in kiosk app session. | 35 // open or running in kiosk app session. |
36 WmShell* wm_shell = WmShell::Get(); | 36 SessionController* session_controller = Shell::Get()->session_controller(); |
37 SessionController* session_controller = wm_shell->session_controller(); | |
38 SystemTrayDelegate* system_tray_delegate = | 37 SystemTrayDelegate* system_tray_delegate = |
39 Shell::Get()->system_tray_delegate(); | 38 Shell::Get()->system_tray_delegate(); |
| 39 WmShell* wm_shell = WmShell::Get(); |
40 return session_controller->IsActiveUserSessionStarted() && | 40 return session_controller->IsActiveUserSessionStarted() && |
41 !session_controller->IsScreenLocked() && | 41 !session_controller->IsScreenLocked() && |
42 !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned() && | 42 !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned() && |
43 system_tray_delegate->GetUserLoginStatus() != LoginStatus::KIOSK_APP && | 43 system_tray_delegate->GetUserLoginStatus() != LoginStatus::KIOSK_APP && |
44 system_tray_delegate->GetUserLoginStatus() != | 44 system_tray_delegate->GetUserLoginStatus() != |
45 LoginStatus::ARC_KIOSK_APP; | 45 LoginStatus::ARC_KIOSK_APP; |
46 } | 46 } |
47 | 47 |
48 bool WindowSelectorController::ToggleOverview() { | 48 bool WindowSelectorController::ToggleOverview() { |
49 if (IsSelecting()) { | 49 if (IsSelecting()) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 void WindowSelectorController::OnSelectionStarted() { | 128 void WindowSelectorController::OnSelectionStarted() { |
129 if (!last_selection_time_.is_null()) { | 129 if (!last_selection_time_.is_null()) { |
130 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", | 130 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", |
131 base::Time::Now() - last_selection_time_); | 131 base::Time::Now() - last_selection_time_); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 } // namespace ash | 135 } // namespace ash |
OLD | NEW |