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

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

Issue 1149833006: Stop the OverviewButton from appearing on the Add-User screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/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/metrics/user_metrics_recorder.h" 9 #include "ash/metrics/user_metrics_recorder.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 12 matching lines...) Expand all
23 WindowSelectorController::WindowSelectorController() { 23 WindowSelectorController::WindowSelectorController() {
24 } 24 }
25 25
26 WindowSelectorController::~WindowSelectorController() { 26 WindowSelectorController::~WindowSelectorController() {
27 } 27 }
28 28
29 // static 29 // static
30 bool WindowSelectorController::CanSelect() { 30 bool WindowSelectorController::CanSelect() {
31 // Don't allow a window overview if the screen is locked or a modal dialog is 31 // Don't allow a window overview if the screen is locked or a modal dialog is
32 // open or running in kiosk app session. 32 // open or running in kiosk app session.
33 return Shell::GetInstance()->session_state_delegate()-> 33 return Shell::GetInstance()
34 IsActiveUserSessionStarted() && 34 ->session_state_delegate()
35 ->IsActiveUserSessionStarted() &&
35 !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && 36 !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() &&
37 Shell::GetInstance()->session_state_delegate()->GetSessionState() ==
38 SessionStateDelegate::SESSION_STATE_ACTIVE &&
36 !Shell::GetInstance()->IsSystemModalWindowOpen() && 39 !Shell::GetInstance()->IsSystemModalWindowOpen() &&
37 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus() != 40 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus() !=
38 user::LOGGED_IN_KIOSK_APP; 41 user::LOGGED_IN_KIOSK_APP;
39 } 42 }
40 43
41 void WindowSelectorController::ToggleOverview() { 44 void WindowSelectorController::ToggleOverview() {
42 if (IsSelecting()) { 45 if (IsSelecting()) {
43 OnSelectionEnded(); 46 OnSelectionEnded();
44 } else { 47 } else {
45 // Don't start overview if window selection is not allowed. 48 // Don't start overview if window selection is not allowed.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 87
85 void WindowSelectorController::OnSelectionStarted() { 88 void WindowSelectorController::OnSelectionStarted() {
86 if (!last_selection_time_.is_null()) { 89 if (!last_selection_time_.is_null()) {
87 UMA_HISTOGRAM_LONG_TIMES( 90 UMA_HISTOGRAM_LONG_TIMES(
88 "Ash.WindowSelector.TimeBetweenUse", 91 "Ash.WindowSelector.TimeBetweenUse",
89 base::Time::Now() - last_selection_time_); 92 base::Time::Now() - last_selection_time_);
90 } 93 }
91 } 94 }
92 95
93 } // namespace ash 96 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698