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

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

Issue 2761063002: Move more from WmShell to Shell (Closed)
Patch Set: merge 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
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_event_handler.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 17 matching lines...) Expand all
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 WmShell* wm_shell = WmShell::Get();
37 SessionController* session_controller = wm_shell->session_controller(); 37 SessionController* session_controller = wm_shell->session_controller();
38 SystemTrayDelegate* system_tray_delegate = wm_shell->system_tray_delegate(); 38 SystemTrayDelegate* system_tray_delegate =
39 Shell::Get()->system_tray_delegate();
39 return session_controller->IsActiveUserSessionStarted() && 40 return session_controller->IsActiveUserSessionStarted() &&
40 !session_controller->IsScreenLocked() && 41 !session_controller->IsScreenLocked() &&
41 !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned() && 42 !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned() &&
42 system_tray_delegate->GetUserLoginStatus() != LoginStatus::KIOSK_APP && 43 system_tray_delegate->GetUserLoginStatus() != LoginStatus::KIOSK_APP &&
43 system_tray_delegate->GetUserLoginStatus() != 44 system_tray_delegate->GetUserLoginStatus() !=
44 LoginStatus::ARC_KIOSK_APP; 45 LoginStatus::ARC_KIOSK_APP;
45 } 46 }
46 47
47 bool WindowSelectorController::ToggleOverview() { 48 bool WindowSelectorController::ToggleOverview() {
48 if (IsSelecting()) { 49 if (IsSelecting()) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 127
127 void WindowSelectorController::OnSelectionStarted() { 128 void WindowSelectorController::OnSelectionStarted() {
128 if (!last_selection_time_.is_null()) { 129 if (!last_selection_time_.is_null()) {
129 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", 130 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse",
130 base::Time::Now() - last_selection_time_); 131 base::Time::Now() - last_selection_time_);
131 } 132 }
132 } 133 }
133 134
134 } // namespace ash 135 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_event_handler.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698