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

Side by Side Diff: ash/metrics/user_metrics_recorder.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/focus_cycler_unittest.cc ('k') | ash/mus/bridge/wm_shell_mus.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/metrics/user_metrics_recorder.h" 5 #include "ash/metrics/user_metrics_recorder.h"
6 6
7 #include "ash/common/metrics/pointer_metrics_recorder.h" 7 #include "ash/common/metrics/pointer_metrics_recorder.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/shelf/shelf_model.h" 10 #include "ash/common/shelf/shelf_model.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // TODO: We probably want to recorde PINNED state. 78 // TODO: We probably want to recorde PINNED state.
79 active_window_state_type = ACTIVE_WINDOW_STATE_TYPE_OTHER; 79 active_window_state_type = ACTIVE_WINDOW_STATE_TYPE_OTHER;
80 break; 80 break;
81 } 81 }
82 } 82 }
83 return active_window_state_type; 83 return active_window_state_type;
84 } 84 }
85 85
86 // Returns true if kiosk mode is active. 86 // Returns true if kiosk mode is active.
87 bool IsKioskModeActive() { 87 bool IsKioskModeActive() {
88 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() == 88 return Shell::Get()->system_tray_delegate()->GetUserLoginStatus() ==
89 LoginStatus::KIOSK_APP; 89 LoginStatus::KIOSK_APP;
90 } 90 }
91 91
92 // Returns true if ARC kiosk mode is active. 92 // Returns true if ARC kiosk mode is active.
93 bool IsArcKioskModeActive() { 93 bool IsArcKioskModeActive() {
94 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() == 94 return Shell::Get()->system_tray_delegate()->GetUserLoginStatus() ==
95 LoginStatus::ARC_KIOSK_APP; 95 LoginStatus::ARC_KIOSK_APP;
96 } 96 }
97 97
98 // Returns true if there is an active user and their session isn't currently 98 // Returns true if there is an active user and their session isn't currently
99 // locked. 99 // locked.
100 bool IsUserActive() { 100 bool IsUserActive() {
101 switch (WmShell::Get()->system_tray_delegate()->GetUserLoginStatus()) { 101 switch (Shell::Get()->system_tray_delegate()->GetUserLoginStatus()) {
102 case LoginStatus::NOT_LOGGED_IN: 102 case LoginStatus::NOT_LOGGED_IN:
103 case LoginStatus::LOCKED: 103 case LoginStatus::LOCKED:
104 return false; 104 return false;
105 case LoginStatus::USER: 105 case LoginStatus::USER:
106 case LoginStatus::OWNER: 106 case LoginStatus::OWNER:
107 case LoginStatus::GUEST: 107 case LoginStatus::GUEST:
108 case LoginStatus::PUBLIC: 108 case LoginStatus::PUBLIC:
109 case LoginStatus::SUPERVISED: 109 case LoginStatus::SUPERVISED:
110 case LoginStatus::KIOSK_APP: 110 case LoginStatus::KIOSK_APP:
111 case LoginStatus::ARC_KIOSK_APP: 111 case LoginStatus::ARC_KIOSK_APP:
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 return IsUserActive() && !IsKioskModeActive() && !IsArcKioskModeActive(); 646 return IsUserActive() && !IsKioskModeActive() && !IsArcKioskModeActive();
647 } 647 }
648 648
649 void UserMetricsRecorder::StartTimer() { 649 void UserMetricsRecorder::StartTimer() {
650 timer_.Start(FROM_HERE, 650 timer_.Start(FROM_HERE,
651 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), 651 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds),
652 this, &UserMetricsRecorder::RecordPeriodicMetrics); 652 this, &UserMetricsRecorder::RecordPeriodicMetrics);
653 } 653 }
654 654
655 } // namespace ash 655 } // namespace ash
OLDNEW
« no previous file with comments | « ash/focus_cycler_unittest.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698