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

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

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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/wm/maximize_mode/maximize_mode_window_state.cc ('k') | ash/wm/screen_pinning_controller.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/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/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 14 matching lines...) Expand all
25 25
26 // static 26 // static
27 bool WindowSelectorController::CanSelect() { 27 bool WindowSelectorController::CanSelect() {
28 // Don't allow a window overview if the screen is locked or a modal dialog is 28 // Don't allow a window overview if the screen is locked or a modal dialog is
29 // open or running in kiosk app session. 29 // open or running in kiosk app session.
30 SessionStateDelegate* session_state_delegate = 30 SessionStateDelegate* session_state_delegate =
31 WmShell::Get()->GetSessionStateDelegate(); 31 WmShell::Get()->GetSessionStateDelegate();
32 return session_state_delegate->IsActiveUserSessionStarted() && 32 return session_state_delegate->IsActiveUserSessionStarted() &&
33 !session_state_delegate->IsScreenLocked() && 33 !session_state_delegate->IsScreenLocked() &&
34 !WmShell::Get()->IsSystemModalWindowOpen() && 34 !WmShell::Get()->IsSystemModalWindowOpen() &&
35 !WmShell::Get()->IsPinned() &&
35 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != 36 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() !=
36 LoginStatus::KIOSK_APP; 37 LoginStatus::KIOSK_APP;
37 } 38 }
38 39
39 void WindowSelectorController::ToggleOverview() { 40 void WindowSelectorController::ToggleOverview() {
40 if (IsSelecting()) { 41 if (IsSelecting()) {
41 OnSelectionEnded(); 42 OnSelectionEnded();
42 } else { 43 } else {
43 // Don't start overview if window selection is not allowed. 44 // Don't start overview if window selection is not allowed.
44 if (!CanSelect()) 45 if (!CanSelect())
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 83
83 void WindowSelectorController::OnSelectionStarted() { 84 void WindowSelectorController::OnSelectionStarted() {
84 if (!last_selection_time_.is_null()) { 85 if (!last_selection_time_.is_null()) {
85 UMA_HISTOGRAM_LONG_TIMES( 86 UMA_HISTOGRAM_LONG_TIMES(
86 "Ash.WindowSelector.TimeBetweenUse", 87 "Ash.WindowSelector.TimeBetweenUse",
87 base::Time::Now() - last_selection_time_); 88 base::Time::Now() - last_selection_time_);
88 } 89 }
89 } 90 }
90 91
91 } // namespace ash 92 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_window_state.cc ('k') | ash/wm/screen_pinning_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698