Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Side by Side Diff: ash/common/wm/overview/window_selector_controller.cc

Issue 2761063002: Move more from WmShell to Shell (Closed)
Patch Set: cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
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 WmShell* wm_shell = WmShell::Get();
37 SessionStateDelegate* session_state_delegate = 37 SessionStateDelegate* session_state_delegate =
38 wm_shell->GetSessionStateDelegate(); 38 wm_shell->GetSessionStateDelegate();
39 SystemTrayDelegate* system_tray_delegate = wm_shell->system_tray_delegate(); 39 SystemTrayDelegate* system_tray_delegate =
40 Shell::Get()->system_tray_delegate();
40 return session_state_delegate->IsActiveUserSessionStarted() && 41 return session_state_delegate->IsActiveUserSessionStarted() &&
41 !session_state_delegate->IsScreenLocked() && 42 !session_state_delegate->IsScreenLocked() &&
42 !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned() && 43 !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned() &&
43 system_tray_delegate->GetUserLoginStatus() != LoginStatus::KIOSK_APP && 44 system_tray_delegate->GetUserLoginStatus() != LoginStatus::KIOSK_APP &&
44 system_tray_delegate->GetUserLoginStatus() != 45 system_tray_delegate->GetUserLoginStatus() !=
45 LoginStatus::ARC_KIOSK_APP; 46 LoginStatus::ARC_KIOSK_APP;
46 } 47 }
47 48
48 bool WindowSelectorController::ToggleOverview() { 49 bool WindowSelectorController::ToggleOverview() {
49 if (IsSelecting()) { 50 if (IsSelecting()) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 127 }
127 128
128 void WindowSelectorController::OnSelectionStarted() { 129 void WindowSelectorController::OnSelectionStarted() {
129 if (!last_selection_time_.is_null()) { 130 if (!last_selection_time_.is_null()) {
130 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", 131 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse",
131 base::Time::Now() - last_selection_time_); 132 base::Time::Now() - last_selection_time_);
132 } 133 }
133 } 134 }
134 135
135 } // namespace ash 136 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698