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

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

Issue 2498613003: Add ARC++ kiosk menu items and ability to start kiosk session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge IsRunningInForcedAndroidAppMode() method with IsRunningInForcedAppMode() Created 4 years, 1 month 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 15 matching lines...) Expand all
26 delayed_animations_) { 26 delayed_animations_) {
27 animation_observer->Shutdown(); 27 animation_observer->Shutdown();
28 } 28 }
29 } 29 }
30 30
31 // static 31 // static
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();
oshima 2016/11/16 19:52:35 nit: would you mind to get the pointer to WmShell
Sergey Poromov 2016/11/17 12:33:13 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698